外观
Seedance-2 创建
Seedance-2 使用原生任务接口创建视频生成任务。该接口为异步接口,创建成功后返回任务 ID,可通过回调或查询接口获取结果。
适用场景
需要使用 Seedance-2 原生任务协议、多模态参考素材、回调或 Asset:// 授权素材时使用该接口。回调仅在请求中提供有效 callback_url 后生效;未配置时通过查询接口获取结果。
Base URL
https://vip.xmsmartlink.com
Endpoint
POST /v1/task/create
请求头
| Header | 必填 | 说明 |
|---|---|---|
Authorization | 是 | Bearer <API_KEY>。 |
Content-Type | 是 | application/json。 |
参数说明
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | 是 | 模型名称,例如 doubao-seedance-2.0。 |
content | array | 是 | 多模态内容数组;每个 item 根据 type 提供对应字段。 |
generate_audio | boolean | 否 | 是否生成音频。 |
ratio | string | 否 | 视频画幅比例,例如 16:9、9:16。 |
duration | number | 否 | 视频时长,单位秒。 |
watermark | boolean | 否 | 是否添加水印。 |
callback_url | string | 否 | 任务状态变化回调地址。 |
resolution | string | 否 | 输出分辨率,例如 720p。 |
seed | integer | 否 | 随机种子。 |
content 字段
移动端可横向滑动查看完整参数。
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
type | string | 是 | 内容类型,可传 text、image_url、video_url、audio_url。 |
text | string | 条件必填 | type=text 时传入提示词。 |
image_url.url | string | 条件必填 | type=image_url 时传入公网图片 URL 或 Asset:// 地址。 |
video_url.url | string | 条件必填 | type=video_url 时传入公网视频 URL 或 Asset:// 地址。 |
audio_url.url | string | 条件必填 | type=audio_url 时传入公网音频 URL 或 Asset:// 地址。 |
role | string | 否 | 素材角色,例如 reference_image、first_frame、last_frame、reference_video、reference_audio。 |
素材要求
Seedance-2 接口不支持 base64 图片。图片、视频和音频素材需要先上传到云存储,使用公网 URL 调用;真人授权素材可以先通过审核系列入库,再在对应的 url 字段传入素材审核返回的 Asset:// 地址。
完整的审核上传、Asset:// 获取和跨域鉴权示例,请查看审核素材用于 Seedance-2。
请求示例
bash
curl -X POST https://vip.xmsmartlink.com/v1/task/create \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $API_KEY" \
-d '{
"model": "doubao-seedance-2.0",
"content": [
{
"type": "text",
"text": "全程使用视频1的第一视角构图,全程使用音频1作为背景音乐,生成一段果茶宣传视频。"
},
{
"type": "image_url",
"image_url": {
"url": "https://example.com/image1.jpg"
},
"role": "reference_image"
},
{
"type": "video_url",
"video_url": {
"url": "https://example.com/video1.mp4"
},
"role": "reference_video"
},
{
"type": "audio_url",
"audio_url": {
"url": "https://example.com/audio1.mp3"
},
"role": "reference_audio"
}
],
"generate_audio": true,
"ratio": "16:9",
"duration": 11,
"watermark": false
}'首尾帧示例
json
{
"model": "doubao-seedance-2.0",
"content": [
{
"type": "text",
"text": "根据首帧和尾帧图片,生成流畅过渡的高清视频"
},
{
"type": "image_url",
"image_url": {
"url": "https://example.com/first.jpg"
},
"role": "first_frame"
},
{
"type": "image_url",
"image_url": {
"url": "https://example.com/last.jpg"
},
"role": "last_frame"
}
],
"generate_audio": true,
"ratio": "16:9",
"duration": 8,
"watermark": false
}已授权真人素材示例
json
{
"model": "doubao-seedance-2.0",
"content": [
{
"type": "text",
"text": "<your prompt>"
},
{
"type": "image_url",
"image_url": {
"url": "Asset://asset-20260421174640-kqkcc"
},
"role": "reference_image"
}
]
}响应示例
json
{
"id": "cgt-20260416141540-t7n9r"
}创建成功后立即保存 id。该值用于 GET /v1/task/get/{id} 查询,也用于取消任务。
错误与重试
400:检查model、content和素材字段结构。401:检查 Bearer Token。500或创建请求超时:请求可能已到达服务端;先从响应、回调或业务记录确认是否已获得任务 ID,再决定是否重试,避免创建重复任务。- 创建成功后按异步任务指南处理查询和结果保存;只有配置了
callback_url时才等待回调。
API Reference
底层接口定义已收录在左侧“底层 API Reference / Seedance-2 视频”分组中。
