Seedance 系列通过 AIOAGI 视频任务接口调用。你可以使用 POST /videos 创建视频任务,再使用 GET /videos/{task_id} 查询任务结果。
Seedance 模型名称、价格、分辨率、时长、音频支持和任务状态字段可能变化。生产调用前,请在 控制台、GET /models 或 开发者指南 中核对当前可用模型。
接口概览
| 能力 | 接口 | 方法 | 说明 |
|---|
| 创建视频任务 | /videos | POST | 提交文生视频、图生视频或参考生视频任务。 |
| 查询视频任务 | /videos/{task_id} | GET | 查询任务状态、进度和视频结果。 |
文生视频示例
export AIO_API_KEY="sk-your-api-key"
export AIO_BASE_URL="https://api.aiearth.dev/v1"
curl "$AIO_BASE_URL/videos" \
-H "Authorization: Bearer $AIO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"aspect_ratio": "16:9",
"capability": "video_generation",
"control_mode": "none",
"duration_seconds": 5,
"input_mode": "text",
"model": "doubao-seedance-2-0-260128",
"prompt": "一段未来科技展台的产品发布短片,镜头缓慢推进,金属材质,高级商业广告质感。",
"resolution": "720p",
"with_audio": true
}'
图生视频示例
curl "$AIO_BASE_URL/videos" \
-H "Authorization: Bearer $AIO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"aspect_ratio": "16:9",
"capability": "video_generation",
"control_mode": "end_frame",
"duration_seconds": 5,
"end_image": "https://example.com/last-frame.png",
"image": "https://example.com/first-frame.png",
"input_mode": "single_image",
"model": "doubao-seedance-2-0-260128",
"prompt": "让画面从产品特写自然过渡到完整展示,镜头轻微推进,光线保持柔和。",
"resolution": "720p",
"with_audio": true
}'
参考生视频示例
{
"aspect_ratio": "16:9",
"capability": "video_generation",
"control_mode": "reference",
"duration_seconds": 5,
"input_mode": "multi_image",
"model": "doubao-seedance-2-0-260128",
"prompt": "参考素材中的人物站在海边,夕阳下回眸一笑,镜头从中景缓慢推进。",
"reference_images": [
"asset://asset-20260519163832-example"
],
"resolution": "720p",
"with_audio": true
}
查询任务结果
提交成功后,响应通常会包含 task_id。你可以按固定间隔轮询任务状态:
curl "$AIO_BASE_URL/videos/{task_id}" \
-H "Authorization: Bearer $AIO_API_KEY"
任务状态通常包括 queued、running、succeeded、completed 和 failed。如果任务失败,请读取 error_message 并记录请求体、模型名、任务 ID 和时间窗口。
核心参数
| 参数 | 类型 | 说明 |
|---|
model | string | 必填。Seedance 模型 ID,例如 doubao-seedance-2-0-260128。 |
capability | string | 视频任务使用 video_generation。 |
prompt | string | 描述视频内容、镜头、动作、风格和约束。当前资料中最大长度为 2500 字符。 |
input_mode | string | text 表示文生视频,single_image 表示图生视频,multi_image 表示参考生视频。 |
control_mode | string | 文生视频通常用 none,首尾帧图生视频可用 end_frame,参考生视频可用 reference。 |
aspect_ratio | string | 当前资料列出 16:9、4:3、1:1、3:4、9:16、21:9、adaptive。 |
duration_seconds | integer | 当前资料列出 4 到 15 秒,或 -1 自动。 |
resolution | string | 当前资料列出 480p、720p、1080p。实际可用范围以控制台为准。 |
with_audio | boolean | 是否同步生成音频。 |
image | string | 图生视频首帧图片。支持 HTTP(S) URL、data:image/...;base64,... 或 base64。 |
end_image | string | 图生视频可选尾帧图片,用于首尾帧控制。 |
reference_images | array | 参考生视频素材列表。当前资料中可使用素材库 asset:// 引用。 |
排障建议
- 遇到
401,检查 API Key 和 Authorization 请求头。
- 遇到
403,检查账户余额、Token 组额度和模型权限。
- 遇到
404 或 model_not_found,核对 base URL、模型 ID 和 task_id。
- 遇到
429,降低提交并发和轮询频率,并加入指数退避。
- 遇到
500 或 502,记录任务 ID 和时间窗口,稍后重试或联系服务支持。