Appearance
Seedance2.0超分模型文档
官方折扣版请使用完整模型编码创建视频任务. 创建成功后返回 id, 请使用查询任务接口获取最终视频.
所有请求都需要在请求头中包含 Bearer token:
bash
Authorization: Bearer {{key}}支持的模型
doubao-seedance-2.0-cf-720pdoubao-seedance-2.0-cf-1080p
Seedance2.0 超分版视频创建任务
可选字段. 完整模型编码已包含分辨率. 如传入该字段, 必须与模型编码中的分辨率一致.
| 参数 | 类型 | 说明 |
|---|---|---|
| ratio | string | 输出比例,默认 16:9。可选值:16:9、9:16、1:1、4:3、3:4、21:9、adaptive。 |
| duration | integer | 视频时长,单位秒,默认 5,范围 4-15。 |
| generate_audio | boolean | 是否生成音频,默认 true。 |
| return_last_frame | boolean | 是否返回尾帧图片,默认 false。设置为 true 且任务生成尾帧时,可在查询接口读取last_frame_url。 |
| tools | array | 高级工具配置,默认不传。不同模型或场景支持的工具能力可能不同,请按实际开通能力传入。 |
| seed | integer | 随机种子,默认 -1,表示由模型服务随机生成。传入固定值可提升生成结果的可复现性;模型生成仍存在概率性,不保证完全一致。 |
| content | array | 多模态内容数组。必须包含一个 type=text 的提示词。 |
| content[].type | string | 内容类型:text、image_url、video_url、audio_url。 |
| content[].role | string | 素材角色:first_frame、last_frame、reference_image、reference_video、reference_audio。 |
| content[].image_url.url | string | 图片地址。支持公网 URL。如提前上传素材到素材库,也可传素材id,格式: assetId://{assetId} |
| content[].video_url.url | string | 视频地址。支持公网 URL。如提前上传素材到素材库,也可传素材id,格式: assetId://{assetId} |
| content[].audio_url.url | string | 音频地址。支持公网 URL。如提前上传素材到素材库,也可传素材id,格式: assetId://{assetId} |
响应参数
| 参数 | 类型 | 说明 |
|---|---|---|
| id | string | 视频生成任务 ID,用于查询任务状态和结果。 |
| object | string | 对象类型,固定为 video。 |
| created | integer | 任务创建时间戳。 |
| model | string | 本次请求使用的模型名称。 |
| status | string | 任务状态,创建成功后通常为 queued 或 processing。 |
状态说明
| 状态值 | 说明 |
|---|---|
| queued | 已创建,等待执行 |
请求报文示例
json
{
"model": "doubao-seedance-2.0-cf-720p",
"ratio": "16:9",
"duration": 5,
"return_last_frame": true,
"generate_audio": false,
"content": [
{
"type": "text",
"text": "一只可爱的小猫在草地上玩耍,镜头缓慢推进,画面明亮自然"
}
]
}json
{
"model": "doubao-seedance-2.0-cf-720p",
"ratio": "16:9",
"duration": 5,
"return_last_frame": true,
"content": [
{
"type": "text",
"text": "图中女孩对着镜头说茄子,360 度环绕运镜"
},
{
"type": "image_url",
"role": "first_frame",
"image_url": {
"url": "https://example.com/first.jpeg"
}
},
{
"type": "image_url",
"role": "last_frame",
"image_url": {
"url": "https://example.com/last.jpeg"
}
}
]
}bash
curl --request POST \
--url https://apiok.cc/v1/videos \
--header 'Authorization: Bearer {{key}}' \
--header 'Content-Type: application/json' \
--data '{
"model": "doubao-seedance-2.0-cf-720p",
"ratio": "16:9",
"duration": 5,
"content": [
{
"type": "text",
"text": "一只可爱的小猫在草地上玩耍,镜头缓慢推进,画面明亮自然"
}
]
}'bash
curl --request POST \
--url https://apiok.cc/v1/videos \
--header 'Authorization: Bearer {{key}}' \
--header 'Content-Type: application/json' \
--data '{
"model": "doubao-seedance-2.0-cf-720p",
"ratio": "16:9",
"duration": 5,
"content": [
{
"type": "text",
"text": "图中女孩对着镜头说茄子,360 度环绕运镜"
},
{
"type": "image_url",
"role": "first_frame",
"image_url": {"url": "https://example.com/first.jpeg"}
},
{
"type": "image_url",
"role": "last_frame",
"image_url": {"url": "https://example.com/last.jpeg"}
}
]
}'json
{
"id": "task_id",
"task_id": "task_id",
"object": "video",
"status": "queued",
"model": "doubao-seedance-2.0-cf-720p"
}Seedance2.0 超分版查询任务
通过创建接口返回的 id 查询任务状态。
bash
Authorization: Bearer {{key}}查询参数
| 参数 | 类型 | 说明 |
|---|---|---|
| id | string | 创建任务返回的任务 ID。 |
响应参数
| 参数 | 类型 | 说明 |
|---|---|---|
| id | string | 任务 ID。 |
| task_id | string | 任务 ID。 |
| object | string | 对象类型,固定为 video。 |
| created | integer | 任务创建时间戳。 |
| model | string | 本次任务使用的模型名称。 |
| status | string | 任务状态:queued、in_progress、completed、failed。 |
| error | boject | 失败原因,任务失败时返回。 |
| error.message | string | 失败原因,任务失败时返回。 |
| metadata | object | 视频信息。 |
| metadata.url | string | 视频下载地址 |
状态说明
| 状态值 | 说明 |
|---|---|
| queued | 已创建,等待执行 |
| in_progress | 执行中 |
| completed | 任务成功完成 |
| failed | 任务执行失败 |
bash
curl --request GET \
--url https://apiok.cc/v1/videos/:task_id \
--header 'Authorization: Bearer {{key}}'json
{
"id": "task_id",
"task_id": "task_id",
"object": "video",
"model": "doubao-seedance-2.0-cf-720p",
"status": "completed",
"progress": "100%",
"created_at": 1784391301,
"completed_at": 1784391572,
"metadata": {
"url": "https://apiok.cc/v1/videos/task_id/content"
},
"result_url": "https://apiok.cc/v1/videos/task_id/content"
}视频下载
bash
curl --request GET \
--url https://apiok.cc/v1/videos/:task_id/content \
--header 'Authorization: Bearer {{key}}'⚠️ 注意
如果想要加快视频生成的时间,可以提前调用以下素材创建接口,素材创建成功后(查询素材创建结果的Status为Active),在视频创建的时候url传入"assetId://{assetId}"
创建素材接口
assetType类型:Image(图片)、Video(视频)、Audio(音频)
请求示例
bash
curl --location 'https://apiok.cc/v1/asset/create' \
--header 'Authorization: Bearer api密钥' \
--header 'Content-Type: application/json' \
--data '{
"model": "doubao-seedance-2.0-cf-720p",
"assetType": "Image",
"url": "https://amzn-sub2api.s3.ap-southeast-1.amazonaws.com/newapi/uploads/1785745458553719000.png"
}'- 响应
json
{
"code": "success",
"message": "",
"data": {
"assetId": "asset-20260803172041-kt6gr"
}
}- 成功code: "success"
- 失败code: "failed", message: 失败原因
查询素材创建结果
- 请求示例
bash
curl --location 'http://localhost:3301/v1/asset/result' \
--header 'Authorization: Bearer api密钥' \
--header 'Content-Type: application/json' \
--data '{
"model": "doubao-seedance-2.0-cf-720p",
"assetId": "asset-20260803172041-kt6gr"
}'- 响应示例
json
{
"code": "success",
"message": "",
"data": {
"assetType": "Image",
"assetId": "asset-20260803172041-kt6gr",
"Name": "",
"status": "ACTIVE",
"error": "失败的时候返回失败原因"
}
}请求成功code: "success",失败"failed"
status包含以下状态,仅Active的时候素材才是可用的,其它状态素材均不可用
NONE:素材记录已创建,但尚未开始上传或处理。请稍后再次查询,当前不可提交任务。
UPLOADING:素材正在上传。请等待状态更新,当前不可提交任务。
PROCESSING:素材正在处理中。请稍后再次查询,当前不可提交任务。
ACTIVE:素材已处理完成且可用。只有此状态可以提交视频生成任务。
FAILED:素材处理失败。请查看 errorMessage,处理问题后重新提交素材。
EXPIRED:素材已过期,当前不可用。请继续查询并等待重新处理为 ACTIVE,必要时重新提交素材。
DELETED:素材已被删除或已失效,当前不可用。请重新提交素材并等待状态变为 ACTIVE。