id,轮询任务状态,完成后读取 metadata.url。id 放入路径 {task_id}。账号实际可用模型以 GET /v1/models 返回结果为准;Seedance 2 只在 Seedance 专用分组的 API Key 中可见。默认画幅:Seedance 2 省略 aspect_ratio时为16:9;Seedance 2.5 省略时为9:16。两者不同,迁移时请显式填写。
| 模型 | 说明 | 支持分辨率 |
|---|---|---|
seedance-2-0-mini | Mini 变体,使用与 Seedance 2 相同的请求、素材和异步任务合同。 | 480p、720p |
seedance-2-0-fast | 生成速度更快,适合预览和批量创作。 | 480p、720p |
seedance-2-0 | 更重视画面质量、细节和稳定性。 | 480p、720p、1080p、4K |
ref 的内容、类型和角色自动判断生成方式。| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
model | string | 是 | — | seedance-2-0-mini、seedance-2-0-fast 或 seedance-2-0。 |
prompt | string | 是 | — | 视频提示词。普通参考素材使用 @图片N、@视频N、@音频N 引用。 |
duration | integer | 是 | — | 输出视频时长,必须是 4–15 秒之间的整数。 |
resolution | string | 否 | 720p | Mini 和 Fast 支持 480p、720p;标准版还支持 1080p、4K。 |
aspect_ratio | string | 否 | 16:9 | 支持 21:9、16:9、4:3、1:1、3:4、9:16。 |
ref | object[] | 按场景 | — | 统一参考素材列表;文生视频时省略。 |
ref 对象| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
url | string | 是 | 无需登录即可读取的 HTTPS 媒体文件直链。 |
type | string | 是 | image、video 或 audio。 |
role | string | 否 | 普通素材可省略;严格首帧填写 first_frame,严格尾帧填写 last_frame。 |
type 与 role 的对应关系:type | 允许的 role | 省略 role 时 |
|---|---|---|
image | reference_image、first_frame、last_frame | 按 reference_image 处理。 |
video | reference_video | 按 reference_video 处理。 |
audio | reference_audio | 按 reference_audio 处理。 |
ref 内容 | 生成方式 |
|---|---|
不传 ref | 文生视频 |
只包含普通 reference_* 素材 | 普通图片或多素材参考视频 |
一张 role=first_frame 图片 | 严格首帧视频 |
一张 first_frame 和一张 last_frame 图片 | 严格首尾帧视频 |
first_frame 可以单独提交;last_frame 必须与 first_frame 同时提交。type 必须是 image,first_frame、last_frame 各最多一个,排列顺序不限。ref 第一项就成为严格首帧,必须显式填写 role=first_frame。ref 中的出现顺序分别从 1 编号:第一张图片是 @图片1,第一个视频是 @视频1,第一段音频是 @音频1。提示词中的类型和编号必须与实际素材一致,不要引用不存在的编号。role 控制,不要求在提示词中使用素材编号。| 类型 | 数量 | 格式 | 单个限制 | 其他限制 |
|---|---|---|---|---|
| 图片 | 0–9 张 | JPEG、PNG、WebP | 不超过 30 MB | 宽高均不小于 300 px;长边不超过 4000 px;宽高比 0.4–2.5。 |
| 视频 | 0–3 段 | MP4、MOV | 2–15 秒,不超过 50 MB | 累计不超过 15 秒;推荐 H.264/H.265、24–60 FPS。 |
| 音频 | 0–3 段 | MP3、WAV | 2–15 秒,不超过 15 MB | 累计不超过 15 秒;不能作为唯一参考。 |
ref 总数为 1–15;9 张图片、3 段视频和 3 段音频是满容量组合,不是最低要求。平台不会补齐空项或静默截断超限素材。type 一致;并应在任务完成前保持有效,避免使用即将过期的签名地址。ref:{
"model": "seedance-2-0-fast",
"prompt": "雨后的未来城市街道,霓虹灯倒映在湿润路面上,镜头缓慢向前推进",
"duration": 5,
"resolution": "720p",
"aspect_ratio": "16:9"
}{
"model": "seedance-2-0",
"prompt": "保持 @图片1 中人物的脸部和服装一致,参考 @视频1 的动作与镜头节奏,说话声音参考 @音频1。",
"duration": 10,
"resolution": "720p",
"aspect_ratio": "16:9",
"ref": [
{ "url": "https://example.com/character.png", "type": "image" },
{ "url": "https://example.com/motion-6s.mp4", "type": "video" },
{ "url": "https://example.com/voice-6s.mp3", "type": "audio" }
]
}first_frame 即为严格首帧请求;提交 last_frame 时必须同时提交 first_frame。{
"model": "seedance-2-0",
"prompt": "从清晨平滑过渡到夜晚,城市霓虹灯依次亮起",
"duration": 8,
"resolution": "1080p",
"aspect_ratio": "16:9",
"ref": [
{ "url": "https://example.com/morning.png", "type": "image", "role": "first_frame" },
{ "url": "https://example.com/night.png", "type": "image", "role": "last_frame" }
]
}{
"model": "seedance-2-0-fast",
"prompt": "参考 @视频1 的动作与镜头节奏生成新视频",
"duration": 4,
"resolution": "720p",
"aspect_ratio": "16:9",
"ref": [
{ "url": "https://example.com/source-video.mp4", "type": "video" }
]
}id,并使用该值查询任务状态:{
"id": "task_xxxxxxxxxxxxxxxxxxxxxxxx",
"object": "video",
"model": "seedance-2-0",
"status": "queued",
"progress": 0,
"created_at": 1780682136
}| 状态 | 说明 |
|---|---|
queued | 任务正在等待处理。 |
in_progress | 视频正在生成。 |
completed | 视频生成完成。 |
failed | 任务失败,读取 error。 |
{
"id": "task_xxxxxxxxxxxxxxxxxxxxxxxx",
"status": "completed",
"metadata": {
"url": "https://example.com/result.mp4"
},
"result_url": "https://example.com/result.mp4"
}metadata.url 读取结果;result_url 与其相同,可作备用。响应可能还包含 object、model、progress、created_at 等辅助字段,字段集合可能变化,客户端不要依赖。结果 URL 带有效期,过期后查询响应中可能不再返回结果地址,请在完成后立即下载或转存。{
"id": "task_xxxxxxxxxxxxxxxxxxxxxxxx",
"status": "failed",
"error": {
"code": "task_failed",
"message": "提示词审核不通过"
}
}status 和 error.message。| HTTP 状态 | 常见原因 |
|---|---|
400 | 参数、时长、分辨率、画幅、素材数量或组合错误;查询的任务不存在时也返回 400,code 为 task_not_exist |
401 | API Key 缺失或无效 |
403 | 余额或额度不足,或当前 API Key 没有模型或分组权限 |
429 | 请求过于频繁 |
503 | 服务暂时不可用 |
500 / 502 | 服务暂时异常 |
model、prompt 或 duration;时长、分辨率或画幅不受支持;ref 字段不完整;type 与 role 不匹配;首尾帧组合不合法;普通与严格帧素材混用;素材数量、文件大小、尺寸、时长或宽高比超限;音频作为唯一参考;素材编号不存在或类型不匹配;素材 URL 无法读取或返回内容不符;以及提示词或素材触发内容安全策略。status 为 failed,具体原因见 error.code 和 error.message。请勿向视频接口传入聊天接口使用的 messages、temperature、top_p、stream 等参数。