API 概览

e5eAi 提供完全兼容 OpenAI 接口格式的大模型统一网关,已接入 GPT、Claude、DeepSeek、GLM、Kimi、Gemini、Qwen 等数十种主流 AI 模型。通过一套标准 API,即可无缝调用对话、图片理解、视频生成、代码编程、语音合成(TTS)、语音识别(ASR)、深度推理、工具调用等全场景 AI 能力。

Base URL
所有 API 请求的基础地址:https://api.service.e5e.cn/ai/v1
💬

语言模型

Chat Completions,支持流式/非流式,兼容 OpenAI SDK

🖼️

图片理解

Vision 多模态,支持图片 URL 和 Base64 输入

🎨

图片生成

文生图,支持多种图片生成模型

🎬

视频生成

文生视频 / 图生视频,异步任务 + 状态查询

💻

代码生成

Codex 专用接口,编程与代码推理

📦

海量模型

30+ 模型,覆盖文本/视觉/视频/代码全场景

鉴权方式

所有 API 请求需要在 HTTP Header 中携带有效的 API Key 进行身份认证。

认证方式
在所有请求的 Header 中添加:
Authorization: Bearer YOUR_API_KEY

获取 API Key

登录 e5eAi 控制台,前往 API 令牌 页面创建和管理密钥。每个账户可创建多个 Key,支持分别设置权限等级和调用限额。

⚠️ 安全提示
请勿在客户端代码或公共仓库中暴露 API Key。建议通过环境变量或后端服务转发请求。Key 泄露可能导致余额被盗用。

模型列表

获取当前可用的所有模型及其信息。

接口地址

GET https://api.service.e5e.cn/ai/v1/models

请求参数

参数位置必填说明
AuthorizationHeaderBearer 认证,格式 Bearer…_KEY

响应格式

字段类型说明
objectstring固定 list
dataarray模型列表,每项含 idobject("model")、owned_by
GET /v1/models 获取可用模型列表

返回所有已发布且非维护状态的模型,包含模型 ID、所属厂商、能力标签等信息。

curl https://api.service.e5e.cn/ai/v1/models \
  -H "Authorization: Bearer YOUR_API_KEY"
from openai import OpenAI

# 初始化客户端
client = OpenAI(
    base_url="https://api.service.e5e.cn/ai/v1",
    api_key="YOUR_API_KEY",
)

# 列出所有模型
for m in client.models.list().data:
    print(f"{m.id:35s} {m.owned_by}")
const resp = await fetch("https://api.service.e5e.cn/ai/v1/models", {
  headers: { "Authorization": "Bearer YOUR_API_KEY" }
});
const data = await resp.json();
data.data.forEach(m => console.log(m.id, m.owned_by));
package main

import (
	"encoding/json"
	"fmt"
	"net/http"
)

func main() {
	req, _ := http.NewRequest("GET", "https://api.service.e5e.cn/ai/v1/models", nil)
	req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
	resp, _ := http.DefaultClient.Do(req)
	defer resp.Body.Close()
	var result map[string]interface{}
	json.NewDecoder(resp.Body).Decode(&result)
	for _, m := range result["data"].([]interface{}) {
		model := m.(map[string]interface{})
		fmt.Println(model["id"], model["owned_by"])
	}
}
using System.Net.Http.Headers;
using System.Text.Json;

var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_API_KEY");
var response = await client.GetAsync("https://api.service.e5e.cn/ai/v1/models");
var json = JsonSerializer.Deserialize<JsonElement>(await response.Content.ReadAsStringAsync());
foreach (var m in json.GetProperty("data").EnumerateArray())
    Console.WriteLine($"{m.GetProperty("id").GetString()} {m.GetProperty("owned_by").GetString()}");
<?php
$ch = curl_init("https://api.service.e5e.cn/ai/v1/models");
curl_setopt_array($ch, [
    CURLOPT_HTTPHEADER => ["Authorization: Bearer YOUR_API_KEY"],
    CURLOPT_RETURNTRANSFER => true,
]);
$result = json_decode(curl_exec($ch), true);
foreach ($result["data"] as $m) echo $m["id"] . " " . $m["owned_by"] . "\n";
curl_close($ch);

响应示例

{
  "object": "list",
  "data": [
    { "id": "gpt-5.4",             "object": "model", "owned_by": "openai" },
    { "id": "gpt-5.4-mini",        "object": "model", "owned_by": "openai" },
    { "id": "gpt-5.3-codex",       "object": "model", "owned_by": "openai" },
    { "id": "claude-opus-4-7",     "object": "model", "owned_by": "anthropic" },
    { "id": "claude-sonnet-4-6",   "object": "model", "owned_by": "anthropic" },
    { "id": "DeepSeek-V3.2",       "object": "model", "owned_by": "deepseek" },
    { "id": "DeepSeek-R1-0528",    "object": "model", "owned_by": "deepseek" },
    { "id": "GLM-5.1",             "object": "model", "owned_by": "zhipu" },
    { "id": "Kimi-K2.5",           "object": "model", "owned_by": "moonshot" },
    { "id": "gemini-3.1-pro-preview", "object": "model", "owned_by": "google" }
  ]
}

健康检查

查看各模型的可用状态和延迟数据。

接口地址

GET https://api.service.e5e.cn/ai/v1/models/health

请求参数

无需认证,无需请求体。

响应格式

字段类型说明
healthobject模型健康状态映射,key 为模型 ID,value 含 available + latencyMs
capabilitiesobject模型能力标签映射
labelsobject能力标签中文名称
GET /api/models/health 模型健康状态
curl https://api.service.e5e.cn/ai/v1/models/health
import requests
resp = requests.get("https://api.service.e5e.cn/ai/v1/models/health")
data = resp.json()
for model, info in data.get("health", {}).items():
    avail = "✅" if info.get("available") else "❌"
    print(f"{model}: {avail} ({info.get('latencyMs', '?')}ms)")
const resp = await fetch("https://api.service.e5e.cn/ai/v1/models/health");
const data = await resp.json();
for (const [model, info] of Object.entries(data.health || {})) {
  const avail = info.available ? "✅" : "❌";
  console.log(model + ": " + avail + " (" + (info.latencyMs || "?") + "ms)");
}
package main

import (
	"encoding/json"
	"fmt"
	"net/http"
)

func main() {
	resp, _ := http.Get("https://api.service.e5e.cn/ai/v1/models/health")
	defer resp.Body.Close()
	var result map[string]interface{}
	json.NewDecoder(resp.Body).Decode(&result)
	health := result["health"].(map[string]interface{})
	for model, info := range health {
		m := info.(map[string]interface{})
		avail := "❌"
		if m["available"].(bool) { avail = "✅" }
		fmt.Printf("%s: %s (%vms)\n", model, avail, m["latencyMs"])
	}
}
using System.Text.Json;

var client = new HttpClient();
var response = await client.GetAsync("https://api.service.e5e.cn/ai/v1/models/health");
var json = JsonSerializer.Deserialize<JsonElement>(await response.Content.ReadAsStringAsync());
foreach (var entry in json.GetProperty("health").EnumerateObject()) {
    var info = entry.Value;
    var avail = info.GetProperty("available").GetBoolean() ? "✅" : "❌";
    Console.WriteLine(entry.Name + ": " + avail + " (" + info.GetProperty("latencyMs") + "ms)");
}
<?php
$ch = curl_init("https://api.service.e5e.cn/ai/v1/models/health");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = json_decode(curl_exec($ch), true);
foreach ($result["health"] as $model => $info) {
    $avail = $info["available"] ? "✅" : "❌";
    echo $model . ": " . $avail . " (" . $info["latencyMs"] . "ms)\n";
}
curl_close($ch);

响应示例

{
  "health": {
    "gpt-5.4": { "available": true, "latencyMs": 2449, "lastChecked": 1715367049000 },
    "DeepSeek-V3.2": { "available": true, "latencyMs": 1804, "lastChecked": 1715367049000 }
  }
}

💬 语言模型

Chat Completions 接口,完全兼容 OpenAI SDK 格式。支持流式(SSE)和非流式两种返回方式。

接口地址

POST https://api.service.e5e.cn/ai/v1/chat/completions

请求体参数

参数类型必填说明
modelstring模型名称,如 gpt-5.4DeepSeek-V3.2claude-sonnet-4.5
messagesarray对话消息列表,格式同 OpenAI
streamboolean是否流式返回,默认 false
max_tokensinteger最大生成 token 数
temperaturenumber采样温度 (0~2),默认 1.0
top_pnumber核采样 (0~1),默认 1.0
POST /v1/chat/completions 聊天对话(非流式)
curl https://api.service.e5e.cn/ai/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "gpt-5.4",
    "messages": [{"role": "user", "content": "你好"}],
    "stream": false
  }'
from openai import OpenAI

client = OpenAI(base_url="https://api.service.e5e.cn/ai/v1", api_key="YOUR_API_KEY")
response = client.chat.completions.create(
    model="gpt-5.4",
    messages=[{"role": "user", "content": "你好"}]
)
print(response.choices[0].message.content)
import OpenAI from 'openai';

const client = new OpenAI({ baseURL: 'https://api.service.e5e.cn/ai/v1', apiKey: 'YOUR_API_KEY' });
const response = await client.chat.completions.create({
  model: 'gpt-5.4',
  messages: [{ role: 'user', content: '你好' }],
});
console.log(response.choices[0].message.content);
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"net/http"
)

func main() {
	body, _ := json.Marshal(map[string]interface{}{
		"model":    "gpt-5.4",
		"messages": []map[string]string{{"role": "user", "content": "你好"}},
		"stream":   false,
	})
	resp, _ := http.Post("https://api.service.e5e.cn/ai/v1/chat/completions",
		"application/json", bytes.NewReader(body))
	defer resp.Body.Close()
	var result map[string]interface{}
	json.NewDecoder(resp.Body).Decode(&result)
	choices := result["choices"].([]interface{})
	fmt.Println(choices[0].(map[string]interface{})["message"].(map[string]interface{})["content"])
}
using System.Text.Json;

var client = new HttpClient();
var payload = JsonSerializer.Serialize(new {
    model = "gpt-5.4",
    messages = new[] { new { role = "user", content = "你好" } },
    stream = false
});
var content = new StringContent(payload, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api.service.e5e.cn/ai/v1/chat/completions", content);
var json = JsonSerializer.Deserialize<JsonElement>(await response.Content.ReadAsStringAsync());
Console.WriteLine(json.GetProperty("choices")[0].GetProperty("message").GetProperty("content"));
<?php
$ch = curl_init("https://api.service.e5e.cn/ai/v1/chat/completions");
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_HTTPHEADER => ["Content-Type: application/json", "Authorization: Bearer YOUR_API_KEY"],
    CURLOPT_POSTFIELDS => json_encode([
        "model" => "gpt-5.4",
        "messages" => [["role" => "user", "content" => "你好"]],
        "stream" => false,
    ]),
    CURLOPT_RETURNTRANSFER => true,
]);
$result = json_decode(curl_exec($ch), true);
echo $result["choices"][0]["message"]["content"] . "\n";
curl_close($ch);
import java.net.http.*;
import java.net.URI;
import com.google.gson.*;

public class ChatExample {
    public static void main(String[] args) throws Exception {
        HttpClient client = HttpClient.newHttpClient();
        JsonObject body = new JsonObject();
        body.addProperty("model", "gpt-5.4");
        JsonArray messages = new JsonArray();
        JsonObject msg = new JsonObject();
        msg.addProperty("role", "user");
        msg.addProperty("content", "你好");
        messages.add(msg);
        body.add("messages", messages);
        body.addProperty("stream", false);

        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://api.service.e5e.cn/ai/v1/chat/completions"))
            .header("Content-Type", "application/json")
            .header("Authorization", "Bearer YOUR_API_KEY")
            .POST(HttpRequest.BodyPublishers.ofString(body.toString()))
            .build();
        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
        JsonObject json = JsonParser.parseString(response.body()).getAsJsonObject();
        System.out.println(json.getAsJsonArray("choices").get(0).getAsJsonObject()
            .getAsJsonObject("message").get("content").getAsString());
    }
}

👁️ 图片理解

Vision 多模态能力,支持通过图片 URL 或 Base64 编码方式输入图片,由兼容的多模态模型进行理解和分析。

接口地址

POST https://api.service.e5e.cn/ai/v1/chat/completions

消息格式

图文消息使用 content 数组格式,每个元素可以是文本或图片:

POST /v1/chat/completions 图文理解(图片 URL)
curl https://api.service.e5e.cn/ai/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "claude-sonnet-4.5",
    "messages": [{
      "role": "user",
      "content": [
        {"type": "text", "text": "请描述这张图片"},
        {"type": "image_url", "image_url": {"url": "https://example.com/photo.jpg"}}
      ]
    }]
  }'
from openai import OpenAI

client = OpenAI(base_url="https://api.service.e5e.cn/ai/v1", api_key="YOUR_API_KEY")
response = client.chat.completions.create(
    model="claude-sonnet-4.5",
    messages=[{
        "role": "user",
        "content": [
            {"type": "text", "text": "请描述这张图片"},
            {"type": "image_url", "image_url": {"url": "https://example.com/photo.jpg"}}
        ]
    }]
)
print(response.choices[0].message.content)
import OpenAI from 'openai';

const client = new OpenAI({ baseURL: 'https://api.service.e5e.cn/ai/v1', apiKey: 'YOUR_API_KEY' });
const response = await client.chat.completions.create({
  model: 'claude-sonnet-4.5',
  messages: [{
    role: 'user',
    content: [
      { type: 'text', text: '请描述这张图片' },
      { type: 'image_url', image_url: { url: 'https://example.com/photo.jpg' } }
    ]
  }]
});
console.log(response.choices[0].message.content);
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"net/http"
)

func main() {
	body, _ := json.Marshal(map[string]interface{}{
		"model": "claude-sonnet-4.5",
		"messages": []map[string]interface{}{
			{
				"role": "user",
				"content": []map[string]interface{}{
					{"type": "text", "text": "请描述这张图片"},
					{"type": "image_url", "image_url": map[string]string{"url": "https://example.com/photo.jpg"}},
				},
			},
		},
	})
	resp, _ := http.Post("https://api.service.e5e.cn/ai/v1/chat/completions",
		"application/json", bytes.NewReader(body))
	defer resp.Body.Close()
	var result map[string]interface{}
	json.NewDecoder(resp.Body).Decode(&result)
	choices := result["choices"].([]interface{})
	fmt.Println(choices[0].(map[string]interface{})["message"].(map[string]interface{})["content"])
}
using System.Text.Json;

var client = new HttpClient();
var payload = JsonSerializer.Serialize(new {
    model = "claude-sonnet-4.5",
    messages = new[] {
        new {
            role = "user",
            content = new object[] {
                new { type = "text", text = "请描述这张图片" },
                new { type = "image_url", image_url = new { url = "https://example.com/photo.jpg" } }
            }
        }
    }
});
var httpContent = new StringContent(payload, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api.service.e5e.cn/ai/v1/chat/completions", httpContent);
var json = JsonSerializer.Deserialize<JsonElement>(await response.Content.ReadAsStringAsync());
Console.WriteLine(json.GetProperty("choices")[0].GetProperty("message").GetProperty("content"));
<?php
$ch = curl_init("https://api.service.e5e.cn/ai/v1/chat/completions");
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_HTTPHEADER => ["Content-Type: application/json", "Authorization: Bearer YOUR_API_KEY"],
    CURLOPT_POSTFIELDS => json_encode([
        "model" => "claude-sonnet-4.5",
        "messages" => [[
            "role" => "user",
            "content" => [
                ["type" => "text", "text" => "请描述这张图片"],
                ["type" => "image_url", "image_url" => ["url" => "https://example.com/photo.jpg"]],
            ],
        ]],
    ]),
    CURLOPT_RETURNTRANSFER => true,
]);
$result = json_decode(curl_exec($ch), true);
echo $result["choices"][0]["message"]["content"] . "\n";
curl_close($ch);
import java.net.http.*;
import java.net.URI;
import com.google.gson.*;

public class VisionExample {
    public static void main(String[] args) throws Exception {
        HttpClient client = HttpClient.newHttpClient();
        JsonObject body = new JsonObject();
        body.addProperty("model", "claude-sonnet-4.5");
        JsonArray messages = new JsonArray();
        JsonObject msg = new JsonObject();
        msg.addProperty("role", "user");
        JsonArray content = new JsonArray();
        JsonObject textContent = new JsonObject();
        textContent.addProperty("type", "text");
        textContent.addProperty("text", "请描述这张图片");
        content.add(textContent);
        JsonObject imgContent = new JsonObject();
        imgContent.addProperty("type", "image_url");
        JsonObject imgUrl = new JsonObject();
        imgUrl.addProperty("url", "https://example.com/photo.jpg");
        imgContent.add("image_url", imgUrl);
        content.add(imgContent);
        msg.add("content", content);
        messages.add(msg);
        body.add("messages", messages);

        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://api.service.e5e.cn/ai/v1/chat/completions"))
            .header("Content-Type", "application/json")
            .header("Authorization", "Bearer YOUR_API_KEY")
            .POST(HttpRequest.BodyPublishers.ofString(body.toString()))
            .build();
        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
        JsonObject json = JsonParser.parseString(response.body()).getAsJsonObject();
        System.out.println(json.getAsJsonArray("choices").get(0).getAsJsonObject()
            .getAsJsonObject("message").get("content").getAsString());
    }
}

Base64 示例

{
  "type": "image_url",
  "image_url": {
    "url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."
  }
}

🎨 图片生成

文生图 / 图生图接口,支持多种图片生成模型。提交任务后获得任务 ID,通过查询接口获取生成结果。

接口地址

POST https://api.service.e5e.cn/ai/v1/images/generations

请求体参数

参数类型必填说明
modelstring模型名称:jimeng-seedream46(即梦 Seedream 4.6)、gpt-image-2(GPT Image 2)等
promptstring图片生成提示词,清晰描述内容和风格。即梦最长 800 字符
qualitystring画质档位,默认 medium。即梦映射为 scale:low(25) / medium(50) / high(75)
ratiostring宽高比,默认 1:1。可选:1:1 / 16:9 / 9:16 / 4:3 / 3:4 / 3:2 / 2:3 / 5:4 / 4:5 / 2:1 / 1:2 / 21:9 / 9:21
resolutionstring分辨率,默认 2k。与 size 二选一。使用 resolution 必须同时传 ratio。1k / 2k / 4k
sizestring直接指定尺寸,传后 resolution 和 ratio 可不传。推荐:1024x1024 / 2048x2048 / 2560x1440 / 4096x4096
image_urlsarray参考图片 URL 数组(图生图模式)。最多 14 张,建议 6 张以内
ninteger生成数量。n=1 强制单图;n>1 组图模式
upscaleboolean设为 true 开启智能超清模式。需要传入 image_urls,支持超清到 4K / 8K。见下方示例
POST /v1/images/generations 图片生成
curl https://api.service.e5e.cn/ai/v1/images/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "jimeng-seedream46",
    "prompt": "一只可爱的橘猫坐在窗台上看日落,油画风格",
    "quality": "high",
    "ratio": "1:1",
    "resolution": "1k"
  }'
import requests

resp = requests.post(
    "https://api.service.e5e.cn/ai/v1/images/generations",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={
        "model": "jimeng-seedream46",
        "prompt": "一只可爱的橘猫坐在窗台上看日落,油画风格",
        "quality": "high",
        "ratio": "1:1",
        "resolution": "1k"
    }
)
print(resp.json())
# 获取 id 后查询结果:
task_id = resp.json().get("id")
result = requests.get(f"https://api.service.e5e.cn/ai/v1/images/generations/{task_id}?model=jimeng-seedream46")
print(result.json())
const resp = await fetch("https://api.service.e5e.cn/ai/v1/images/generations", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Authorization": "Bearer YOUR_API_KEY"
  },
  body: JSON.stringify({
    model: "jimeng-seedream46",
    prompt: "一只可爱的橘猫坐在窗台上看日落,油画风格",
    quality: "high",
    ratio: "1:1",
    resolution: "1k"
  })
});
const data = await resp.json();
console.log(data);
// 获取 id 后查询结果:
const taskId = data.id;
const result = await fetch(`https://api.service.e5e.cn/ai/v1/images/generations/${taskId}?model=jimeng-seedream46`);
console.log(await result.json());
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"net/http"
)

func main() {
	body, _ := json.Marshal(map[string]interface{}{
		"model":      "jimeng-seedream46",
		"prompt":     "一只可爱的橘猫坐在窗台上看日落,油画风格",
		"quality":    "high",
		"ratio":      "1:1",
		"resolution": "1k",
	})
	resp, _ := http.Post("https://api.service.e5e.cn/ai/v1/images/generations",
		"application/json", bytes.NewReader(body))
	defer resp.Body.Close()
	var result map[string]interface{}
	json.NewDecoder(resp.Body).Decode(&result)
	fmt.Println(result)
	// 获取 id 后查询结果:
	taskID := result["id"].(string)
	queryResp, _ := http.Get("https://api.service.e5e.cn/ai/v1/images/generations/" + taskID + "?model=jimeng-seedream46")
	defer queryResp.Body.Close()
	var queryResult map[string]interface{}
	json.NewDecoder(queryResp.Body).Decode(&queryResult)
	fmt.Println(queryResult)
}
using System.Text.Json;

var client = new HttpClient();
var payload = JsonSerializer.Serialize(new {
    model = "jimeng-seedream46",
    prompt = "一只可爱的橘猫坐在窗台上看日落,油画风格",
    quality = "high",
    ratio = "1:1",
    resolution = "1k"
});
var httpContent = new StringContent(payload, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api.service.e5e.cn/ai/v1/images/generations", httpContent);
var json = JsonSerializer.Deserialize<JsonElement>(await response.Content.ReadAsStringAsync());
Console.WriteLine(json);
// 获取 id 后查询结果:
var taskId = json.GetProperty("id").GetString();
var queryResponse = await client.GetAsync($"https://api.service.e5e.cn/ai/v1/images/generations/{taskId}?model=jimeng-seedream46");
Console.WriteLine(await queryResponse.Content.ReadAsStringAsync());
<?php
$ch = curl_init("https://api.service.e5e.cn/ai/v1/images/generations");
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_HTTPHEADER => ["Content-Type: application/json", "Authorization: Bearer YOUR_API_KEY"],
    CURLOPT_POSTFIELDS => json_encode([
        "model" => "jimeng-seedream46",
        "prompt" => "一只可爱的橘猫坐在窗台上看日落,油画风格",
        "quality" => "high",
        "ratio" => "1:1",
        "resolution" => "1k",
    ]),
    CURLOPT_RETURNTRANSFER => true,
]);
$result = json_decode(curl_exec($ch), true);
print_r($result);
curl_close($ch);
// 获取 id 后查询结果:
$taskId = $result["id"];
$queryCh = curl_init("https://api.service.e5e.cn/ai/v1/images/generations/" . $taskId . "?model=jimeng-seedream46");
curl_setopt($queryCh, CURLOPT_RETURNTRANSFER, true);
echo curl_exec($queryCh) . "\n";
curl_close($queryCh);
import java.net.http.*;
import java.net.URI;
import com.google.gson.*;

public class ImageGenExample {
    public static void main(String[] args) throws Exception {
        HttpClient client = HttpClient.newHttpClient();
        JsonObject body = new JsonObject();
        body.addProperty("model", "jimeng-seedream46");
        body.addProperty("prompt", "一只可爱的橘猫坐在窗台上看日落,油画风格");
        body.addProperty("quality", "high");
        body.addProperty("ratio", "1:1");
        body.addProperty("resolution", "1k");

        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://api.service.e5e.cn/ai/v1/images/generations"))
            .header("Content-Type", "application/json")
            .header("Authorization", "Bearer YOUR_API_KEY")
            .POST(HttpRequest.BodyPublishers.ofString(body.toString()))
            .build();
        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
        JsonObject json = JsonParser.parseString(response.body()).getAsJsonObject();
        System.out.println(json);
        // 获取 id 后查询结果:
        String taskId = json.get("id").getAsString();
        HttpRequest queryRequest = HttpRequest.newBuilder()
            .uri(URI.create("https://api.service.e5e.cn/ai/v1/images/generations/" + taskId + "?model=jimeng-seedream46"))
            .GET().build();
        HttpResponse<String> queryResponse = client.send(queryRequest, HttpResponse.BodyHandlers.ofString());
        System.out.println(queryResponse.body());
    }
}

智能超清

传入参考图片进行超清处理,支持 4K / 8K。与文生图共用接口,只需添加 upscale: true

POST /v1/images/generations 图片超清
curl https://api.service.e5e.cn/ai/v1/images/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ***" \
  -d '{
    "model": "jimeng-seedream46",
    "image_urls": ["http://9270.vhost.e5e.cn/attachment/upload/videoscreenshot/20260212/1770866981320.jpg"],
    "upscale": true,
    "resolution": "4k",
    "quality": "medium"
  }'
import requests

resp = requests.post(
    "https://api.service.e5e.cn/ai/v1/images/generations",
    headers={"Authorization": "Bearer…_KEY"},
    json={
        "model": "jimeng-seedream46",
        "image_urls": ["http://9270.vhost.e5e.cn/attachment/upload/videoscreenshot/20260212/1770866981320.jpg"],
        "upscale": True,
        "resolution": "4k",
        "quality": "medium",
    }
)
task_id = resp.json()["id"]
print("Task ID:", task_id)
const resp = await fetch("https://api.service.e5e.cn/ai/v1/images/generations", {
  method: "POST",
  headers: { "Content-Type": "application/json", "Authorization": "Bearer…_KEY" },
  body: JSON.stringify({
    model: "jimeng-seedream46",
    image_urls: ["http://9270.vhost.e5e.cn/attachment/upload/videoscreenshot/20260212/1770866981320.jpg"],
    upscale: true,
    resolution: "4k",
    quality: "medium",
  }),
});
const data = await resp.json();
console.log("Task ID:", data.id);
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"net/http"
)

func main() {
	body, _ := json.Marshal(map[string]interface{}{
		"model":      "jimeng-seedream46",
		"image_urls": []string{"http://9270.vhost.e5e.cn/attachment/upload/videoscreenshot/20260212/1770866981320.jpg"},
		"upscale":    true,
		"resolution": "4k",
		"quality":    "medium",
	})
	resp, _ := http.Post("https://api.service.e5e.cn/ai/v1/images/generations",
		"application/json", bytes.NewReader(body))
	defer resp.Body.Close()
	var result map[string]interface{}
	json.NewDecoder(resp.Body).Decode(&result)
	fmt.Println("Task ID:", result["id"])
}
using System.Text.Json;

var client = new HttpClient();
var payload = JsonSerializer.Serialize(new {
    model = "jimeng-seedream46",
    image_urls = new[] { "http://9270.vhost.e5e.cn/attachment/upload/videoscreenshot/20260212/1770866981320.jpg" },
    upscale = true,
    resolution = "4k",
    quality = "medium",
});
var content = new StringContent(payload, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api.service.e5e.cn/ai/v1/images/generations", content);
var json = JsonSerializer.Deserialize<JsonElement>(await response.Content.ReadAsStringAsync());
Console.WriteLine("Task ID: " + json.GetProperty("id").GetString());
<?php
$ch = curl_init("https://api.service.e5e.cn/ai/v1/images/generations");
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_HTTPHEADER => ["Content-Type: application/json", "Authorization: Bearer ***"],
    CURLOPT_POSTFIELDS => json_encode([
        "model"      => "jimeng-seedream46",
        "image_urls" => ["http://9270.vhost.e5e.cn/attachment/upload/videoscreenshot/20260212/1770866981320.jpg"],
        "upscale"    => true,
        "resolution" => "4k",
        "quality"    => "medium",
    ]),
    CURLOPT_RETURNTRANSFER => true,
]);
$result = json_decode(curl_exec($ch), true);
echo "Task ID: " . $result["id"] . "\n";
curl_close($ch);
import java.net.http.*;
import java.net.URI;
import com.google.gson.*;

public class UpscaleExample {
    public static void main(String[] args) throws Exception {
        HttpClient client = HttpClient.newHttpClient();
        JsonObject body = new JsonObject();
        body.addProperty("model", "jimeng-seedream46");
        JsonArray urls = new JsonArray();
        urls.add("http://9270.vhost.e5e.cn/attachment/upload/videoscreenshot/20260212/1770866981320.jpg");
        body.add("image_urls", urls);
        body.addProperty("upscale", true);
        body.addProperty("resolution", "4k");
        body.addProperty("quality", "medium");

        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://api.service.e5e.cn/ai/v1/images/generations"))
            .header("Content-Type", "application/json")
            .header("Authorization", "Bearer YOUR_API_KEY")
            .POST(HttpRequest.BodyPublishers.ofString(body.toString()))
            .build();
        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
        JsonObject json = JsonParser.parseString(response.body()).getAsJsonObject();
        System.out.println("Task ID: " + json.get("id").getAsString());
    }
}

查询接口

使用生成任务返回的 ID 查询结果:

curl "https://api.service.e5e.cn/ai/v1/images/generations/{task_id}?model=jimeng-seedream46"
import requests

result = requests.get(
    url="https://api.service.e5e.cn/ai/v1/images/generations/{task_id}?model=jimeng-seedream46",
    headers={"Authorization": "Bearer YOUR_API_KEY"}
)
print(result.json())
const resp = await fetch(
  "https://api.service.e5e.cn/ai/v1/images/generations/{task_id}?model=jimeng-seedream46",
  { headers: { "Authorization": "Bearer YOUR_API_KEY" } }
);
const data = await resp.json();
console.log(data);
package main

import (
	"encoding/json"
	"fmt"
	"net/http"
)

func main() {
	resp, _ := http.Get("https://api.service.e5e.cn/ai/v1/images/generations/{task_id}?model=jimeng-seedream46")
	defer resp.Body.Close()
	var result map[string]interface{}
	json.NewDecoder(resp.Body).Decode(&result)
	fmt.Println(result)
}
using System.Text.Json;

var client = new HttpClient();
var response = await client.GetAsync(
    "https://api.service.e5e.cn/ai/v1/images/generations/{task_id}?model=jimeng-seedream46");
var json = JsonSerializer.Deserialize<JsonElement>(await response.Content.ReadAsStringAsync());
Console.WriteLine(json);
<?php
$ch = curl_init("https://api.service.e5e.cn/ai/v1/images/generations/{task_id}?model=jimeng-seedream46");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
echo curl_exec($ch) . "\n";
curl_close($ch);
import java.net.http.*;
import java.net.URI;
import com.google.gson.*;

public class QueryExample {
    public static void main(String[] args) throws Exception {
        HttpClient client = HttpClient.newHttpClient();
        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://api.service.e5e.cn/ai/v1/images/generations/{task_id}?model=jimeng-seedream46"))
            .header("Authorization", "Bearer YOUR_API_KEY")
            .GET()
            .build();
        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
        System.out.println(response.body());
    }
}

🔄 图生图

传入参考图片,AI 基于参考图进行二次创作。支持风格转换、内容修改、局部重绘等多种场景。

接口地址

POST https://api.service.e5e.cn/ai/v1/images/generations

参考图片

以下示例使用这张参考图片进行图生图创作:

图生图参考图片
POST /v1/images/generations 图生图 - 风格转换
curl https://api.service.e5e.cn/ai/v1/images/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "jimeng-seedream46",
    "prompt": "将参考图片转换为赛博朋克风格新闻播报场景,主播着装改为未来感套装,背景添加全息屏幕和数据流,霓虹灯光效,电影级质感",
    "image_urls": ["http://9270.vhost.e5e.cn/attachment/upload/videoscreenshot/20260212/1770866981320.jpg"],
    "quality": "high",
    "resolution": "1k"
  }'
import requests

resp = requests.post(
    "https://api.service.e5e.cn/ai/v1/images/generations",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={
        "model": "jimeng-seedream46",
        "prompt": "将参考图片转换为赛博朋克风格新闻播报场景,主播着装改为未来感套装,背景添加全息屏幕和数据流,霓虹灯光效,电影级质感",
        "image_urls": ["http://9270.vhost.e5e.cn/attachment/upload/videoscreenshot/20260212/1770866981320.jpg"],
        "quality": "high",
        "resolution": "1k"
    }
)
print(resp.json())
task_id = resp.json().get("id")
result = requests.get(f"https://api.service.e5e.cn/ai/v1/images/generations/{task_id}?model=jimeng-seedream46")
print(result.json())
const resp = await fetch("https://api.service.e5e.cn/ai/v1/images/generations", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Authorization": "Bearer YOUR_API_KEY"
  },
  body: JSON.stringify({
    model: "jimeng-seedream46",
    prompt: "将参考图片转换为赛博朋克风格新闻播报场景,主播着装改为未来感套装,背景添加全息屏幕和数据流,霓虹灯光效,电影级质感",
    image_urls: ["http://9270.vhost.e5e.cn/attachment/upload/videoscreenshot/20260212/1770866981320.jpg"],
    quality: "high",
    resolution: "1k"
  })
});
const data = await resp.json();
console.log(data);
const taskId = data.id;
const result = await fetch(`https://api.service.e5e.cn/ai/v1/images/generations/${taskId}?model=jimeng-seedream46`);
console.log(await result.json());
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"net/http"
)

func main() {
	body, _ := json.Marshal(map[string]interface{}{
		"model":      "jimeng-seedream46",
		"prompt":     "将参考图片转换为赛博朋克风格新闻播报场景,主播着装改为未来感套装,背景添加全息屏幕和数据流,霓虹灯光效,电影级质感",
		"image_urls": []string{"http://9270.vhost.e5e.cn/attachment/upload/videoscreenshot/20260212/1770866981320.jpg"},
		"quality":    "high",
		"resolution": "1k",
	})
	resp, _ := http.Post("https://api.service.e5e.cn/ai/v1/images/generations",
		"application/json", bytes.NewReader(body))
	defer resp.Body.Close()
	var result map[string]interface{}
	json.NewDecoder(resp.Body).Decode(&result)
	fmt.Println(result)
	taskID := result["id"].(string)
	queryResp, _ := http.Get("https://api.service.e5e.cn/ai/v1/images/generations/" + taskID + "?model=jimeng-seedream46")
	defer queryResp.Body.Close()
	var queryResult map[string]interface{}
	json.NewDecoder(queryResp.Body).Decode(&queryResult)
	fmt.Println(queryResult)
}
using System.Text.Json;

var client = new HttpClient();
var payload = JsonSerializer.Serialize(new {
    model = "jimeng-seedream46",
    prompt = "将参考图片转换为赛博朋克风格新闻播报场景,主播着装改为未来感套装,背景添加全息屏幕和数据流,霓虹灯光效,电影级质感",
    image_urls = new[] { "http://9270.vhost.e5e.cn/attachment/upload/videoscreenshot/20260212/1770866981320.jpg" },
    quality = "high",
    resolution = "1k"
});
var httpContent = new StringContent(payload, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api.service.e5e.cn/ai/v1/images/generations", httpContent);
var json = JsonSerializer.Deserialize<JsonElement>(await response.Content.ReadAsStringAsync());
Console.WriteLine(json);
var taskId = json.GetProperty("id").GetString();
var queryResponse = await client.GetAsync($"https://api.service.e5e.cn/ai/v1/images/generations/{taskId}?model=jimeng-seedream46");
Console.WriteLine(await queryResponse.Content.ReadAsStringAsync());
<?php
$ch = curl_init("https://api.service.e5e.cn/ai/v1/images/generations");
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_HTTPHEADER => ["Content-Type: application/json", "Authorization: Bearer YOUR_API_KEY"],
    CURLOPT_POSTFIELDS => json_encode([
        "model" => "jimeng-seedream46",
        "prompt" => "将参考图片转换为赛博朋克风格新闻播报场景,主播着装改为未来感套装,背景添加全息屏幕和数据流,霓虹灯光效,电影级质感",
        "image_urls" => ["http://9270.vhost.e5e.cn/attachment/upload/videoscreenshot/20260212/1770866981320.jpg"],
        "quality" => "high",
        "resolution" => "1k",
    ]),
    CURLOPT_RETURNTRANSFER => true,
]);
$result = json_decode(curl_exec($ch), true);
print_r($result);
curl_close($ch);
$taskId = $result["id"];
$queryCh = curl_init("https://api.service.e5e.cn/ai/v1/images/generations/" . $taskId . "?model=jimeng-seedream46");
curl_setopt($queryCh, CURLOPT_RETURNTRANSFER, true);
echo curl_exec($queryCh) . "\n";
curl_close($queryCh);
import java.net.http.*;
import java.net.URI;
import com.google.gson.*;

public class Img2ImgExample {
    public static void main(String[] args) throws Exception {
        HttpClient client = HttpClient.newHttpClient();
        JsonObject body = new JsonObject();
        body.addProperty("model", "jimeng-seedream46");
        body.addProperty("prompt", "将参考图片转换为赛博朋克风格新闻播报场景,主播着装改为未来感套装,背景添加全息屏幕和数据流,霓虹灯光效,电影级质感");
        JsonArray urls = new JsonArray();
        urls.add("http://9270.vhost.e5e.cn/attachment/upload/videoscreenshot/20260212/1770866981320.jpg");
        body.add("image_urls", urls);
        body.addProperty("quality", "high");
        body.addProperty("ratio", "9:16");
        body.addProperty("resolution", "1k");

        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://api.service.e5e.cn/ai/v1/images/generations"))
            .header("Content-Type", "application/json")
            .header("Authorization", "Bearer YOUR_API_KEY")
            .POST(HttpRequest.BodyPublishers.ofString(body.toString()))
            .build();
        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
        JsonObject json = JsonParser.parseString(response.body()).getAsJsonObject();
        System.out.println(json);
        String taskId = json.get("id").getAsString();
        HttpRequest queryRequest = HttpRequest.newBuilder()
            .uri(URI.create("https://api.service.e5e.cn/ai/v1/images/generations/" + taskId + "?model=jimeng-seedream46"))
            .GET().build();
        HttpResponse<String> queryResponse = client.send(queryRequest, HttpResponse.BodyHandlers.ofString());
        System.out.println(queryResponse.body());
    }
}

查询接口

使用生成任务返回的 ID 查询结果:

curl "https://api.service.e5e.cn/ai/v1/images/generations/{task_id}?model=jimeng-seedream46"
import requests

result = requests.get(
    url="https://api.service.e5e.cn/ai/v1/images/generations/{task_id}?model=jimeng-seedream46",
    headers={"Authorization": "Bearer YOUR_API_KEY"}
)
print(result.json())
const resp = await fetch(
  "https://api.service.e5e.cn/ai/v1/images/generations/{task_id}?model=jimeng-seedream46",
  { headers: { "Authorization": "Bearer YOUR_API_KEY" } }
);
const data = await resp.json();
console.log(data);
package main

import (
	"encoding/json"
	"fmt"
	"net/http"
)

func main() {
	resp, _ := http.Get("https://api.service.e5e.cn/ai/v1/images/generations/{task_id}?model=jimeng-seedream46")
	defer resp.Body.Close()
	var result map[string]interface{}
	json.NewDecoder(resp.Body).Decode(&result)
	fmt.Println(result)
}
using System.Text.Json;

var client = new HttpClient();
var response = await client.GetAsync("https://api.service.e5e.cn/ai/v1/images/generations/{task_id}?model=jimeng-seedream46");
var json = JsonSerializer.Deserialize<JsonElement>(await response.Content.ReadAsStringAsync());
Console.WriteLine(json);
<?php
$ch = curl_init("https://api.service.e5e.cn/ai/v1/images/generations/{task_id}?model=jimeng-seedream46");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = json_decode(curl_exec($ch), true);
print_r($result);
curl_close($ch);
import java.net.http.*;
import java.net.URI;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.service.e5e.cn/ai/v1/images/generations/{task_id}?model=jimeng-seedream46"))
    .GET()
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());

🎬 视频生成

文生视频 / 图生视频 / 数字人视频,异步任务模式。提交生成任务后后台自动处理,返回结果或任务 ID 用于查询进度。

🎬 支持的视频生成模型

模型 ID说明类型
doubao-seedance-2-0-fast-260128Seedance 2.0 极速版文/图生视频
doubao-seedance-2-0-260128Seedance 2.0 专业版文/图生视频
e5e_Human2.5数字人视频生成(上传参考视频+音频,AI 自动生成对口型视频)数字人
e5e_imgdigital图片数字人(上传参考图片+音频,AI 让图片开口说话)数字人

接口地址

POST /v1/video/generations 创建视频生成任务
GET /v1/video/generations/{task_id} 查询任务状态 & 获取结果

请求参数(创建任务)

参数类型必填说明
modelstring视频生成模型 ID,见上方模型列表
contentarray是*内容数组,支持多种媒体类型(文/图/视频/音频)。
*也可传入 prompt 自动转换为 content
content[].typestring内容类型:text / image_url / video_url / audio_url
content[].textstring看情况type=text 时的提示词文本
content[].image_urlobject看情况type=image_url 时的图片对象。
{"url": "https://..."}
content[].video_urlobject看情况type=video_url 时的参考视频对象。
{"url": "https://..."}
content[].audio_urlobject看情况type=audio_url 时的参考音频对象。
{"url": "https://..."}
content[].rolestring媒体角色:reference_image / reference_video / reference_audio
generate_audioboolean是否生成音频(默认 true
ratiostring画面比例:16:9 / 9:16 / 1:1(默认 16:9
durationinteger视频时长(秒),可选 5 / 8 / 10 / 11(默认 5)
watermarkboolean是否添加水印(默认 false

📝 示例一:文生视频(Seedance)

curl -X POST https://api.service.e5e.cn/ai/v1/video/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "doubao-seedance-2-0-260128",
    "content": [
      { "type": "text", "text": "一只小猫在草地上奔跑" }
    ],
    "generate_audio": true,
    "ratio": "16:9",
    "duration": 5,
    "watermark": false
  }'
import requests, time

API = "https://api.service.e5e.cn/ai"
KEY = "YOUR_API_KEY"
headers = {"Authorization": f"Bearer {KEY}", "Content-Type": "application/json"}

# 创建任务
resp = requests.post(f"{API}/v1/video/generations", headers=headers, json={
    "model": "doubao-seedance-2-0-260128",
    "content": [{"type": "text", "text": "一只小猫在草地上奔跑"}],
    "generate_audio": True,
    "ratio": "16:9",
    "duration": 5
})
task = resp.json()
print("任务已创建:", task.get("id", task))

# 如果返回 202,需要手动轮询
if resp.status_code == 202 or task.get("status") == "processing":
    task_id = task["id"]
    while True:
        time.sleep(3)
        result = requests.get(f"{API}/v1/video/generations/{task_id}", headers=headers).json()
        print(f"状态: {result.get('status')}")
        if result.get("status") == "succeeded":
            print("视频URL:", result["content"][0]["video_url"])
            break
        elif result.get("status") == "failed":
            print("失败:", result.get("error", {}).get("message"))
            break
const API = "https://api.service.e5e.cn/ai";
const KEY = "YOUR_API_KEY";
const headers = { Authorization: `Bearer ${KEY}`, "Content-Type": "application/json" };

// 创建任务
const resp = await fetch(`${API}/v1/video/generations`, {
  method: "POST", headers,
  body: JSON.stringify({
    model: "doubao-seedance-2-0-260128",
    content: [{ type: "text", text: "一只小猫在草地上奔跑" }],
    generate_audio: true, ratio: "16:9", duration: 5
  })
});
const task = await resp.json();
console.log("任务已创建:", task.id);

// 轮询结果
const poll = setInterval(async () => {
  const r = await fetch(`${API}/v1/video/generations/${task.id}`, { headers });
  const data = await r.json();
  console.log("状态:", data.status);
  if (data.status === "succeeded") {
    console.log("视频URL:", data.content[0].video_url);
    clearInterval(poll);
  } else if (data.status === "failed") {
    console.log("失败:", data.error?.message);
    clearInterval(poll);
  }
}, 3000);

🖼️ 示例二:图生视频

curl -X POST https://api.service.e5e.cn/ai/v1/video/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "doubao-seedance-2-0-260128",
    "content": [
      { "type": "text", "text": "让这张照片动起来" },
      { "type": "image_url", "image_url": { "url": "https://example.com/photo.jpg" }, "role": "reference_image" }
    ],
    "generate_audio": true,
    "ratio": "16:9",
    "duration": 5
  }'
import requests

resp = requests.post(f"{API}/v1/video/generations", headers=headers, json={
    "model": "doubao-seedance-2-0-260128",
    "content": [
        {"type": "text", "text": "让这张照片动起来"},
        {"type": "image_url", "image_url": {"url": "https://example.com/photo.jpg"}, "role": "reference_image"}
    ],
    "generate_audio": True,
    "ratio": "16:9",
    "duration": 5
})
print(resp.json())
const resp = await fetch(`${API}/v1/video/generations`, {
  method: "POST", headers,
  body: JSON.stringify({
    model: "doubao-seedance-2-0-260128",
    content: [
      { type: "text", text: "让这张照片动起来" },
      { type: "image_url", image_url: { url: "https://example.com/photo.jpg" }, role: "reference_image" }
    ],
    generate_audio: true, ratio: "16:9", duration: 5
  })
});
console.log(await resp.json());

🧑 示例三:数字人视频(e5e_Human2.5)

上传参考视频 + 参考音频,AI 自动生成对口型数字人视频。

curl https://api.service.e5e.cn/ai/v1/video/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-c081ce8bdd8be607361d4f56caadbc6f6341cb6aaeedbffb" \
  -d '{"model":"e5e_Human2.5","audioUrl":"http://9270.vhost.e5e.cn/attachment/upload/ai/wav/20260703/1783062734516.wav","videoUrl":"http://9270.vhost.e5e.cn/attachment/upload/ai/video/20260212/1770866980135.mp4","modelVersion":2}'
import requests, json

resp = requests.post(f"{API}/v1/video/generations", headers=headers, json={
    "model": "e5e_Human2.5",
    "audioUrl": "http://9270.vhost.e5e.cn/attachment/upload/ai/wav/20260703/1783062734516.wav",
    "videoUrl": "http://9270.vhost.e5e.cn/attachment/upload/ai/video/20260212/1770866980135.mp4",
    "modelVersion": 2
})
print(json.dumps(resp.json(), ensure_ascii=False, indent=2))
const resp = await fetch(`${API}/v1/video/generations`, {
  method: "POST", headers,
  body: JSON.stringify({
    model: "e5e_Human2.5",
    audioUrl: "http://9270.vhost.e5e.cn/attachment/upload/ai/wav/20260703/1783062734516.wav",
    videoUrl: "http://9270.vhost.e5e.cn/attachment/upload/ai/video/20260212/1770866980135.mp4",
    modelVersion: 2
  })
});
console.log(await resp.json());

🖼️🎤 示例四:图片数字人(e5e_imgdigital)

上传参考图片 + 参考音频,AI 让图片人物对口型说话。

curl -X POST https://api.service.e5e.cn/ai/v1/video/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ***" \
  -d '{
    "model": "e5e_imgdigital",
    "content": [
      { "type": "text", "text": "一位美女,正在讲话" },
      { "type": "image_url", "image_url": { "url": "http://9270.vhost.e5e.cn/attachment/upload/videoscreenshot/20260205/1770272890548.jpg" }, "role": "reference_video" },
      { "type": "audio_url", "audio_url": { "url": "http://9270.vhost.e5e.cn/attachment/upload/ai/wav/20260703/1783062734516.wav" }, "role": "reference_audio" }
    ]
  }'

# 查询任务状态
curl "https://api.service.e5e.cn/ai/v1/video/generations/{task_id}" \
  -H "Authorization: Bearer ***"
import requests, time

API = "https://api.service.e5e.cn/ai"
KEY = "***"
headers = {"Authorization": f"Bearer {KEY}", "Content-Type": "application/json"}

# 创建任务
resp = requests.post(f"{API}/v1/video/generations", headers=headers, json={
    "model": "e5e_imgdigital",
    "content": [
        {"type": "text", "text": "一位美女,正在讲话"},
        {"type": "image_url", "image_url": {"url": "http://9270.vhost.e5e.cn/attachment/upload/videoscreenshot/20260205/1770272890548.jpg"}, "role": "reference_video"},
        {"type": "audio_url", "audio_url": {"url": "http://9270.vhost.e5e.cn/attachment/upload/ai/wav/20260703/1783062734516.wav"}, "role": "reference_audio"}
    ]
})
task = resp.json()
print("任务已创建:", task.get("id", task))

# 轮询结果
task_id = task.get("id")
if task_id:
    while True:
        time.sleep(3)
        result = requests.get(f"{API}/v1/video/generations/{task_id}", headers=headers).json()
        print(f"状态: {result.get('status')}")
        if result.get("status") == "succeeded":
            print("视频URL:", result["content"][0]["video_url"])
            break
        elif result.get("status") == "failed":
            print("失败:", result.get("error", {}).get("message"))
            break
const API = "https://api.service.e5e.cn/ai";
const KEY = "***";
const headers = { Authorization: `Bearer ${KEY}`, "Content-Type": "application/json" };

// 创建任务
const resp = await fetch(`${API}/v1/video/generations`, {
  method: "POST", headers,
  body: JSON.stringify({
    model: "e5e_imgdigital",
    content: [
      { type: "text", text: "一位美女,正在讲话" },
      { type: "image_url", image_url: { url: "http://9270.vhost.e5e.cn/attachment/upload/videoscreenshot/20260205/1770272890548.jpg" }, role: "reference_video" },
      { type: "audio_url", audio_url: { url: "http://9270.vhost.e5e.cn/attachment/upload/ai/wav/20260703/1783062734516.wav" }, role: "reference_audio" }
    ]
  })
});
const task = await resp.json();
console.log("任务已创建:", task.id);

// 轮询结果
const poll = setInterval(async () => {
  const r = await fetch(`${API}/v1/video/generations/${task.id}`, { headers });
  const data = await r.json();
  console.log("状态:", data.status);
  if (data.status === "succeeded") {
    console.log("视频URL:", data.content[0].video_url);
    clearInterval(poll);
  } else if (data.status === "failed") {
    console.log("失败:", data.error?.message);
    clearInterval(poll);
  }
}, 3000);

查询任务状态

curl "https://api.service.e5e.cn/ai/v1/video/generations/{task_id}" \
  -H "Authorization: Bearer YOUR_API_KEY"
import requests

result = requests.get(
    f"{API}/v1/video/generations/{task_id}",
    headers={"Authorization": f"Bearer {KEY}"}
).json()
print("状态:", result.get("status"))
if result.get("content"):
    print("视频URL:", result["content"][0]["video_url"])
const r = await fetch(`${API}/v1/video/generations/${taskId}`, {
  headers: { Authorization: `Bearer ${KEY}` }
});
const data = await r.json();
console.log("状态:", data.status);
if (data.content) console.log("视频URL:", data.content[0].video_url);

响应格式

创建成功(同步完成,返回 200):

{
  "id": "cgt-abc123",
  "object": "video",
  "model": "doubao-seedance-2-0-260128",
  "status": "succeeded",
  "content": [
    { "video_url": "https://example.com/generated-video.mp4" }
  ],
  "_local": {
    "cost": 4.0000,
    "balance": 96.0000
  }
}

仍在处理(返回 202,客户端需轮询):

{
  "id": "cgt-abc123",
  "object": "video",
  "model": "doubao-seedance-2-0-260128",
  "status": "processing",
  "message": "任务仍在处理中,请通过 GET /v1/video/generations/cgt-abc123 查询结果"
}

查询任务结果(GET):

{
  "id": "cgt-abc123",
  "status": "succeeded",
  "content": [
    { "video_url": "https://example.com/generated-video.mp4" }
  ],
  "model": "doubao-seedance-2-0-260128"
}

💻 代码生成

Codex 专用接口,针对编程与代码推理场景优化。支持代码补全、Bug 修复、代码解释等任务。

接口地址

POST https://api.service.e5e.cn/ai/v1/responses

Codex 模型使用 /v1/responses 端点,而非 /v1/chat/completions。同时兼容 gpt-5.3-codex 等模型走标准 Chat Completions 接口。

POST /v1/chat/completions 代码生成(标准接口)
curl https://api.service.e5e.cn/ai/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "gpt-5.3-codex",
    "messages": [
      {"role": "user", "content": "用 TypeScript 写一个快速排序函数"}
    ]
  }'
from openai import OpenAI

client = OpenAI(base_url="https://api.service.e5e.cn/ai/v1", api_key="YOUR_API_KEY")
response = client.chat.completions.create(
    model="gpt-5.3-codex",
    messages=[{"role": "user", "content": "用 TypeScript 写一个快速排序函数"}]
)
print(response.choices[0].message.content)
import OpenAI from 'openai';

const client = new OpenAI({ baseURL: 'https://api.service.e5e.cn/ai/v1', apiKey: 'YOUR_API_KEY' });
const response = await client.chat.completions.create({
  model: 'gpt-5.3-codex',
  messages: [{ role: 'user', content: '用 TypeScript 写一个快速排序函数' }],
});
console.log(response.choices[0].message.content);
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"net/http"
)

func main() {
	body, _ := json.Marshal(map[string]interface{}{
		"model": "gpt-5.3-codex",
		"messages": []map[string]string{
			{"role": "user", "content": "用 TypeScript 写一个快速排序函数"},
		},
	})
	resp, _ := http.Post("https://api.service.e5e.cn/ai/v1/chat/completions",
		"application/json", bytes.NewReader(body))
	defer resp.Body.Close()
	var result map[string]interface{}
	json.NewDecoder(resp.Body).Decode(&result)
	choices := result["choices"].([]interface{})
	fmt.Println(choices[0].(map[string]interface{})["message"].(map[string]interface{})["content"])
}
using System.Text.Json;

var client = new HttpClient();
var payload = JsonSerializer.Serialize(new {
    model = "gpt-5.3-codex",
    messages = new[] { new { role = "user", content = "用 TypeScript 写一个快速排序函数" } }
});
var content = new StringContent(payload, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api.service.e5e.cn/ai/v1/chat/completions", content);
var json = JsonSerializer.Deserialize<JsonElement>(await response.Content.ReadAsStringAsync());
Console.WriteLine(json.GetProperty("choices")[0].GetProperty("message").GetProperty("content"));
<?php
$ch = curl_init("https://api.service.e5e.cn/ai/v1/chat/completions");
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_HTTPHEADER => ["Content-Type: application/json", "Authorization: Bearer YOUR_API_KEY"],
    CURLOPT_POSTFIELDS => json_encode([
        "model" => "gpt-5.3-codex",
        "messages" => [["role" => "user", "content" => "用 TypeScript 写一个快速排序函数"]],
    ]),
    CURLOPT_RETURNTRANSFER => true,
]);
$result = json_decode(curl_exec($ch), true);
echo $result["choices"][0]["message"]["content"] . "\n";
curl_close($ch);
import java.net.http.*;
import java.net.URI;
import com.google.gson.*;

public class CodeExample {
    public static void main(String[] args) throws Exception {
        HttpClient client = HttpClient.newHttpClient();
        JsonObject body = new JsonObject();
        body.addProperty("model", "gpt-5.3-codex");
        JsonArray messages = new JsonArray();
        JsonObject msg = new JsonObject();
        msg.addProperty("role", "user");
        msg.addProperty("content", "用 TypeScript 写一个快速排序函数");
        messages.add(msg);
        body.add("messages", messages);

        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://api.service.e5e.cn/ai/v1/chat/completions"))
            .header("Content-Type", "application/json")
            .header("Authorization", "Bearer YOUR_API_KEY")
            .POST(HttpRequest.BodyPublishers.ofString(body.toString()))
            .build();
        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
        JsonObject json = JsonParser.parseString(response.body()).getAsJsonObject();
        System.out.println(json.getAsJsonArray("choices").get(0).getAsJsonObject()
            .getAsJsonObject("message").get("content").getAsString());
    }
}