创建视频任务(新)
1. 公共模型
seedance2.0-480pseedance2.0-720pseedance2.0-1080pseedance2.0-4kseedance2.0-fast-480pseedance2.0-fast-720pseedance2.0-mini-480pseedance2.0-mini-720p
当前对外统一接口:
POST /v1/videos/generationsGET /v1/videos/{task_id}
2. 设计原则
2.1 主推火山原生风格
如果你已经使用火山原生风格的 content[],平台会优先按 content[] 处理。
这意味着:
content[]是主协议type/role是主语义- 如果传了
content[],平台会忽略自封装extra_body.operation
2.2 旧字段只做兼容
以下旧字段继续兼容:
promptimageimagesvideovideosaudioslast_image
但这些旧字段只是兼容层,不再是主推方案。
2.3 extra_body.operation 只保留给兼容层
只有在你没有传 content[]、而是走旧字段兼容写法时,才建议或要求使用:
reference_to_videoedit_videoextend_videofirst_last_frame
如果你已经传了 content[]:
- 即使你再传
extra_body.operation - 平台也会忽略它
3. 模型与允许值
| 模型 | 类型 | 固定分辨率 | 允许 duration | 允许 aspect_ratio |
|---|---|---|---|---|
seedance2.0-480p | 标准版 | 480p | 4 到 15 的整数 | auto / 21:9 / 16:9 / 4:3 / 1:1 / 3:4 / 9:16 |
seedance2.0-720p | 标准版 | 720p | 4 到 15 的整数 | auto / 21:9 / 16:9 / 4:3 / 1:1 / 3:4 / 9:16 |
seedance2.0-1080p | 标准版 | 1080p | 4 到 15 的整数 | auto / 21:9 / 16:9 / 4:3 / 1:1 / 3:4 / 9:16 |
seedance2.0-fast-480p | Fast 版 | 480p | 4 到 15 的整数 | auto / 21:9 / 16:9 / 4:3 / 1:1 / 3:4 / 9:16 |
seedance2.0-fast-720p | Fast 版 | 720p | 4 到 15 的整数 | auto / 21:9 / 16:9 / 4:3 / 1:1 / 3:4 / 9:16 |
补充说明:
- 分辨率由模型锁定。
- 不允许通过
size把480p模型改成720p。 - 如果你要传
size:seedance2.0-480p/seedance2.0-fast-480p只能传480pseedance2.0-720p/seedance2.0-fast-720p只能传720pseedance2.0-1080p/ 只能传1080p
4. 顶层参数说明
4.1 必填参数
| 参数 | 类型 | 是否必填 | 允许值 | 说明 |
|---|---|---|---|---|
model | string | 是 | 4 个公共模型之一 | 公共模型名 |
duration | integer | 是 | 4 到 15 的整数 | 视频秒数 |
4.2 主推参数
| 参数 | 类型 | 是否必填 | 允许值 | 说明 |
|---|---|---|---|---|
content | array | 推荐必填 | 见下文 | 火山原生风格输入 |
aspect_ratio | string | 否 | auto / 21:9 / 16:9 / 4:3 / 1:1 / 3:4 / 9:16 | 宽高比 |
prompt | string | 否 | 任意非空字符串 | 如果你通过 new-api 网关,建议同时传 |
4.3 兼容参数
| 参数 | 类型 | 是否必填 | 允许值 | 说明 |
|---|---|---|---|---|
image | string / object | 否 | 单张图片 URL | 旧字段兼容 |
images | array | 否 | 1 到 9 张图片 URL | 旧字段兼容 |
video | string | 否 | 单条视频 URL | 旧字段兼容 |
videos | array | 否 | 1 到 3 条视频 URL | 旧字段兼容 |
audios | array | 否 | 1 到 3 条音频 URL | 旧字段兼容 |
last_image | string / object | 否 | 单张图片 URL | 旧字段兼容 |
4.4 extra_body 参数
| 参数 | 类型 | 是否必填 | 允许值 | 说明 |
|---|---|---|---|---|
extra_body.generate_audio | boolean | 否 | true / false | 是否生成音频 |
extra_body.seed | integer | 否 | 任意整数 | 随机种子 |
extra_body.watermark | boolean | 否 | true / false | 是否加水印 |
extra_body.camera_fixed | boolean | 否 | true / false | 是否固定镜头 |
extra_body.service_tier | string | 否 | 当前平台不枚举固定值 | 透传给上游 |
extra_body.execution_expires_after | integer | 否 | 正整数 | 透传给上游 |
extra_body.draft | boolean | 否 | true / false | 草稿模式 |
extra_body.return_last_frame | boolean | 否 | true / false | 是否返回最后一帧 |
extra_body.frames | integer | 否 | 正整数 | 帧数 |
extra_body.operation | string | 仅兼容层使用 | reference_to_video / edit_video / extend_video / first_last_frame | 只有旧字段模式才使用;content[] 模式下会被忽略 |
5. content[] 结构
5.1 文本项
{
"type": "text",
"text": "未来城市,交通发达"
}
规则:
type必须是texttext必须是非空字符串- 整个请求至少要有 1 条文本项
5.2 图片项
{
"type": "image_url",
"url": "https://example.com/ref.png",
"role": "reference_image"
}
图片 role 允许值:
imagereference_imagefirst_framelast_frame
5.3 视频项
{
"type": "video_url",
"url": "https://example.com/ref.mp4",
"role": "reference_video"
}
视频 role 允许值:
reference_videosource_video
5.4 音频项
{
"type": "audio_url",
"url": "https://example.com/ref.mp3",
"role": "reference_audio"
}
音频 role 允许值:
reference_audio
6. content[] 模式下各种能力怎么表达
这一节是重点:
- 用户传了
content[] - 平台就按
content[]的type + role理解能力 - 不要求再额外传
extra_body.operation - 即使传了,也会被忽略
6.1 文生视频
{
"model": "seedance2.0-720p",
"content": [
{
"type": "text",
"text": "夜晚的未来城市高架桥,车流穿梭,镜头缓慢推进"
}
],
"duration": 5,
"aspect_ratio": "16:9"
}
6.2 单图生视频
{
"model": "seedance2.0-fast-720p",
"content": [
{
"type": "text",
"text": "让产品缓慢旋转,镜头轻推,保持白底电商风格"
},
{
"type": "image_url",
"url": "https://example.com/product.png",
"role": "image"
}
],
"duration": 5,
"aspect_ratio": "16:9",
"extra_body": {
"generate_audio": false,
"watermark": false
}
}
6.3 首尾帧
{
"model": "seedance2.0-720p",
"content": [
{
"type": "text",
"text": "从起始图平滑过渡到结束图,保持主体一致"
},
{
"type": "image_url",
"url": "https://example.com/start.png",
"role": "first_frame"
},
{
"type": "image_url",
"url": "https://example.com/end.png",
"role": "last_frame"
}
],
"duration": 6,
"aspect_ratio": "16:9"
}
6.4 图片参考模式
{
"model": "seedance2.0-720p",
"content": [
{
"type": "text",
"text": "保持人物外观一致,生成一段站在白色背景前的展示视频"
},
{
"type": "image_url",
"url": "https://example.com/ref-1.png",
"role": "reference_image"
},
{
"type": "image_url",
"url": "https://example.com/ref-2.png",
"role": "reference_image"
}
],
"duration": 8,
"aspect_ratio": "9:16"
}
6.5 全能参考模式
{
"model": "seedance2.0-720p",
"content": [
{
"type": "text",
"text": "保持产品外观一致,参考动作和音频节奏,生成一段电商演示视频"
},
{
"type": "image_url",
"url": "https://example.com/product.png",
"role": "reference_image"
},
{
"type": "video_url",
"url": "https://example.com/motion-guide.mp4",
"role": "reference_video"
},
{
"type": "audio_url",
"url": "https://example.com/music-guide.mp3",
"role": "reference_audio"
}
],
"duration": 10,
"aspect_ratio": "16:9",
"extra_body": {
"generate_audio": true,
"seed": 88,
"watermark": false
}
}
6.6 视频编辑
{
"model": "seedance2.0-720p",
"content": [
{
"type": "text",
"text": "把这段视频改成简洁明亮的电商展示风格"
},
{
"type": "video_url",
"url": "https://example.com/source.mp4",
"role": "source_video"
}
],
"duration": 5,
"aspect_ratio": "16:9",
"extra_body": {
"watermark": false
}
}
6.7 视频延长
{
"model": "seedance2.0-720p",
"content": [
{
"type": "text",
"text": "延续当前镜头运动和场景风格,保持主体一致"
},
{
"type": "video_url",
"url": "https://example.com/source.mp4",
"role": "source_video"
}
],
"duration": 5,
"aspect_ratio": "16:9",
"extra_body": {
"watermark": false
}
}
7. 旧字段兼容写法
这部分只给旧客户端或旧网关兼容使用。
7.1 单图兼容写法
{
"model": "seedance2.0-fast-480p",
"prompt": "让产品轻微旋转",
"image": "https://example.com/product.png",
"duration": 5,
"aspect_ratio": "16:9"
}
7.2 首尾帧兼容写法
{
"model": "seedance2.0-720p",
"prompt": "从起始图平滑过渡到结束图",
"image": "https://example.com/start.png",
"last_image": "https://example.com/end.png",
"duration": 6,
"aspect_ratio": "16:9",
"extra_body": {
"operation": "first_last_frame"
}
}
7.3 多模态参考兼容写法
{
"model": "seedance2.0-720p",
"prompt": "生成一段带参考动作和音频节奏的视频",
"images": [
"https://example.com/ref-1.png"
],
"videos": [
"https://example.com/ref.mp4"
],
"audios": [
"https://example.com/ref.mp3"
],
"duration": 8,
"aspect_ratio": "16:9",
"extra_body": {
"operation": "reference_to_video"
}
}
7.4 旧字段视频编辑 / 延长兼容写法
{
"model": "seedance2.0-720p",
"prompt": "把这段视频改成简洁明亮的电商展示风格",
"video": "https://example.com/source.mp4",
"duration": 5,
"aspect_ratio": "16:9",
"extra_body": {
"operation": "edit_video"
}
}
8. 本站通过new-api调用时
强烈建议同时传顶层 prompt 和 content[0].text。
原因:
- 因采用openai风格,所以
prompt字段必传,否则请求不能到达火山引擎服务
推荐兼容写法:
{
"model": "seedance2.0-fast-480p",
"prompt": "未来城市,交通发达",
"content": [
{
"type": "text",
"text": "未来城市,交通发达"
}
],
"duration": 5,
"aspect_ratio": "16:9",
"extra_body": {
"generate_audio": false,
"watermark": false
}
}
9. 常见错误
错误 1:通过 new-api 只传 content[],不传顶层 prompt
现象:
- 前置层直接报
prompt is required
解决:
- 顶层
prompt和content[0].text同时传
错误 2:content[] 里 role 不合法
图片 role 只允许:
imagereference_imagefirst_framelast_frame
视频 role 只允许:
reference_videosource_video
音频 role 只允许:
reference_audio
错误 3:旧字段兼容模式没传 operation
说明:
- 旧字段本身表达力不足
- 平台需要你显式补语义
例如:
video兼容模式下要配edit_video或extend_videovideos / audios兼容模式下要配reference_to_video
错误 4:尝试覆盖分辨率
说明:
- 模型分辨率由公共模型名锁定
例如:
seedance2.0-fast-480p不能改成720pseedance2.0-720p不能改成480p
10. 响应说明
提交后会返回统一异步任务对象,例如:
{
"id": "task_xxx",
"task_id": "task_xxx",
"object": "video.generation.job",
"model": "seedance2.0-720p",
"status": "queued",
"raw_status": "PENDING",
"progress": 0,
"created_at": 1773980459,
"video_url": null
}
之后轮询:
GET /v1/videos/generations/{task_id}
直到状态变成:
completed- 或
failed
11. 最终建议
一句话总结:
- 如果你会写
content[],就按火山原生风格写,不用再传extra_body.operation - 如果你还在用旧字段兼容写法,再传
extra_body.operation - 如果通过
new-api,建议同时传顶层prompt和content[0].text
接口参数与示例
Endpoint
POST /v1/video/generations
Header 参数
| Name | Type | Required | Description | Example |
|---|---|---|---|---|
Authorization | string | No | Bearer {your_token} |
请求体参数
| Field | Type | Required | Title | Description |
|---|---|---|---|---|
model | string | Yes | 模型名称 | |
prompt | string | Yes | 提示词 | 只有 prompt -> 文生视频 |
image | string | Yes | 单张源图 | 图生视频 |
last_image | string | Yes | 尾帧图 | 首尾帧和image配合使用 |
images | string | Yes | 参考图 URL 数组 | 多图参考输入, '全能参考模式', 图片最多9张 |
audios | string | Yes | 参考音频 URL 数组 | 用于全能参考模式, 最多 3 个,每个 2~15s,总时长 <= 15s |
videos | string | Yes | 参考视频 URL 数组 | 用于全能参考模式, 最多 3 个,每个 2~15s,总时长 <= 15s |
duration | string | Yes | 秒数 | 5到15中的任意值 |
aspect_ratio | string | Yes | 比例 | 9:16、1:1、16:9 |
extra_body | object | No | 扩展 |
请求示例
示例
{
"model": "string",
"prompt": "string",
"image": "string",
"last_image": "string",
"images": "string",
"audios": "string",
"videos": "string",
"duration": "string",
"aspect_ratio": "string",
"extra_body": {
"generate_audio": true,
"seed": "string",
"watermark": "string",
"camera_fixed": "string",
"service_tier": "string",
"execution_expires_after": "string",
"draft": "string",
"return_last_frame": "string",
"frames": "string",
"operation": "string"
}
}
curl -X POST "{BASE_URL}/v1/video/generations" \
-H "Authorization: Bearer sk-***" \
-H "Content-Type: application/json" \
-d '{
"model": "string",
"prompt": "string",
"image": "string",
"last_image": "string",
"images": "string",
"audios": "string",
"videos": "string",
"duration": "string",
"aspect_ratio": "string",
"extra_body": {
"generate_audio": true,
"seed": "string",
"watermark": "string",
"camera_fixed": "string",
"service_tier": "string",
"execution_expires_after": "string",
"draft": "string",
"return_last_frame": "string",
"frames": "string",
"operation": "string"
}
}'
响应字段
| Field | Type | Required | Title | Description |
|---|
响应示例
示例 1
{
"id": "task_xxx",
"error": null,
"model": "seedance2.0-720p",
"object": "video.generation.job",
"result": {
"outputs": [
"https://xxx.aijisu.cn/video/xxxx.mp4"
],
"video_url": "https://xxx.aijisu.cn/video/xxx.mp4"
},
"status": "completed",
"task_id": "task_xxxxx",
"progress": 100,
"video_url": "https://xxx.aijisu.cn/video/xxx.mp4",
"created_at": 1774405050,
"raw_status": "COMPLETED"
}