Skip to main content
Seedance 系列通过 AIOAGI 视频任务接口调用。你可以使用 POST /videos 创建视频任务,再使用 GET /videos/{task_id} 查询任务结果。
Seedance 模型名称、价格、分辨率、时长、音频支持和任务状态字段可能变化。生产调用前,请在 控制台GET /models开发者指南 中核对当前可用模型。

接口概览

能力接口方法说明
创建视频任务/videosPOST提交文生视频、图生视频或参考生视频任务。
查询视频任务/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"
任务状态通常包括 queuedrunningsucceededcompletedfailed。如果任务失败,请读取 error_message 并记录请求体、模型名、任务 ID 和时间窗口。

核心参数

参数类型说明
modelstring必填。Seedance 模型 ID,例如 doubao-seedance-2-0-260128
capabilitystring视频任务使用 video_generation
promptstring描述视频内容、镜头、动作、风格和约束。当前资料中最大长度为 2500 字符。
input_modestringtext 表示文生视频,single_image 表示图生视频,multi_image 表示参考生视频。
control_modestring文生视频通常用 none,首尾帧图生视频可用 end_frame,参考生视频可用 reference
aspect_ratiostring当前资料列出 16:94:31:13:49:1621:9adaptive
duration_secondsinteger当前资料列出 415 秒,或 -1 自动。
resolutionstring当前资料列出 480p720p1080p。实际可用范围以控制台为准。
with_audioboolean是否同步生成音频。
imagestring图生视频首帧图片。支持 HTTP(S) URL、data:image/...;base64,... 或 base64。
end_imagestring图生视频可选尾帧图片,用于首尾帧控制。
reference_imagesarray参考生视频素材列表。当前资料中可使用素材库 asset:// 引用。

排障建议

  • 遇到 401,检查 API Key 和 Authorization 请求头。
  • 遇到 403,检查账户余额、Token 组额度和模型权限。
  • 遇到 404model_not_found,核对 base URL、模型 ID 和 task_id
  • 遇到 429,降低提交并发和轮询频率,并加入指数退避。
  • 遇到 500502,记录任务 ID 和时间窗口,稍后重试或联系服务支持。