Seedance 生视频文档
本文档说明如何通过 WisGate Seedance 生视频接口创建视频任务、查询任务结果,以及当前支持的主要参数范围。资产创建请参阅 Seedance 资产文档。
基础信息
| 项目 |
说明 |
| Base URL |
https://api.wisgate.cn |
| 鉴权方式 |
Authorization: Bearer YOUR_API_KEY |
| 请求格式 |
application/json |
| 创建任务接口 |
POST /api/v3/contents/generations/tasks |
| 查询任务接口 |
GET /api/v3/contents/generations/tasks/{id} |
模型支持
| 模型名称 |
分辨率支持 |
说明 |
doubao-seedance-2 |
480p、720p、1080p |
标准质量,支持首帧、首尾帧、参考素材、联网搜索等能力 |
doubao-seedance-2-fast |
480p、720p |
快速生成,不支持 1080p |
创建视频任务
curl --location --request POST 'https://api.wisgate.cn/api/v3/contents/generations/tasks' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "doubao-seedance-2",
"content": [
{
"type": "text",
"text": "一只小猫在清晨阳光里伸懒腰,镜头缓慢推进,画面温暖自然。"
}
],
"resolution": "720p",
"ratio": "16:9",
"duration": 5,
"seed": -1,
"generate_audio": true,
"watermark": false
}'
请求参数
| 参数 |
类型 |
必填 |
说明 |
model |
string |
是 |
WisGate 模型名,支持 doubao-seedance-2、doubao-seedance-2-fast |
content |
object[] |
是 |
输入内容数组,支持文本、图片、视频、音频 |
duration |
number |
否 |
输出视频时长,单位秒。建议填写 |
resolution |
string |
否 |
输出分辨率:480p、720p、1080p。快速模型不支持 1080p |
ratio |
string |
否 |
输出宽高比:16:9、4:3、1:1、3:4、9:16、21:9、adaptive |
seed |
number |
否 |
随机种子,取值范围 -1 到 2^32-1。-1 表示随机 |
generate_audio |
boolean |
否 |
是否生成同步音频 |
return_last_frame |
boolean |
否 |
是否在查询结果中返回尾帧图像 URL |
tools |
object[] |
否 |
工具列表,目前支持 web_search |
safety_identifier |
string |
否 |
终端用户唯一标识,建议使用不可逆哈希,长度不超过 64 字符 |
execution_expires_after |
number |
否 |
任务超时时间,单位秒。建议范围 3600 到 259200 |
watermark |
boolean |
否 |
当传 false 时关闭显式标识;不传或传 true 时按渠道默认策略处理 |
logo_param |
object |
否 |
显式标识参数,仅在业务确有自定义标识需求时使用 |
callback_url |
string |
否 |
任务状态变化回调地址。回调内容与查询任务结果结构一致 |
content 参数
content 是数组,至少包含一个有效内容项。
| 场景 |
content 组合 |
说明 |
| 文生视频 |
text |
仅使用文本提示词生成视频 |
| 图生视频 |
text + image_url |
图片作为首帧,role 可为 first_frame 或省略 |
| 首尾帧生视频 |
text + 两个 image_url |
两张图片必须分别设置 first_frame 与 last_frame |
| 视频生视频 |
text + video_url |
视频作为参考素材,role 使用 reference_video |
| 参考素材生视频 |
text + image_url / video_url / audio_url |
多模态参考生成,图片使用 reference_image,视频使用 reference_video,音频使用 reference_audio |
| 联网搜索生成 |
text + tools |
通过 tools=[{"type":"web_search"}] 开启联网搜索 |
content item 字段
| 字段 |
类型 |
必填 |
说明 |
type |
string |
是 |
内容类型:text、image_url、video_url、audio_url |
text |
string |
条件必填 |
当 type=text 时填写提示词 |
image_url.url |
string |
条件必填 |
图片 URL、图片 Base64 或 asset://ASSET_ID |
video_url.url |
string |
条件必填 |
视频 URL 或 asset://ASSET_ID |
audio_url.url |
string |
条件必填 |
音频 URL、音频 Base64 或 asset://ASSET_ID |
role |
string |
否 |
资源用途,见下表 |
role 取值
| 类型 |
role |
说明 |
image_url |
first_frame |
首帧图。单图图生视频时可省略 |
image_url |
last_frame |
尾帧图。首尾帧模式需要同时提供 first_frame |
image_url |
reference_image |
参考图 |
video_url |
reference_video |
参考视频 |
audio_url |
reference_audio |
参考音频 |
典型请求示例
图生视频
{
"model": "doubao-seedance-2",
"content": [
{
"type": "text",
"text": "基于首帧生成一段自然流畅的产品展示短视频。"
},
{
"type": "image_url",
"role": "first_frame",
"image_url": {
"url": "https://example.com/first-frame.png"
}
}
],
"resolution": "720p",
"ratio": "16:9",
"duration": 5
}
首尾帧生视频
{
"model": "doubao-seedance-2",
"content": [
{
"type": "text",
"text": "从首帧自然过渡到尾帧,镜头运动平滑。"
},
{
"type": "image_url",
"image_url": {
"url": "https://example.com/first-frame.png"
},
"role": "first_frame"
},
{
"type": "image_url",
"image_url": {
"url": "https://example.com/last-frame.png"
},
"role": "last_frame"
}
],
"resolution": "720p",
"ratio": "16:9",
"duration": 5,
"return_last_frame": true
}
视频生视频
{
"model": "doubao-seedance-2",
"content": [
{
"type": "text",
"text": "参考视频的运动节奏和构图,生成一段新的宣传短视频。"
},
{
"type": "video_url",
"video_url": {
"url": "https://example.com/reference-video.mp4"
},
"role": "reference_video"
}
],
"resolution": "720p",
"ratio": "16:9",
"duration": 5
}
参考素材生视频
{
"model": "doubao-seedance-2",
"content": [
{
"type": "text",
"text": "综合参考图片、参考视频和背景音乐,生成一段自然的广告短视频。"
},
{
"type": "image_url",
"image_url": {
"url": "asset://asset-20260430111413-7mv94"
},
"role": "reference_image"
},
{
"type": "video_url",
"video_url": {
"url": "https://example.com/reference-video.mp4"
},
"role": "reference_video"
},
{
"type": "audio_url",
"audio_url": {
"url": "https://example.com/reference-audio.mp3"
},
"role": "reference_audio"
}
],
"resolution": "720p",
"ratio": "16:9",
"duration": 5,
"generate_audio": true
}
创建响应
{
"id": "1412464707775373312"
}
| 字段 |
类型 |
说明 |
id |
string |
视频生成任务 ID,用于查询任务结果 |
查询视频任务
curl --location --request GET 'https://api.wisgate.cn/api/v3/contents/generations/tasks/1412464707775373312' \
--header 'Authorization: Bearer YOUR_API_KEY'
查询响应示例
{
"id": "1412464707775373312",
"model": "2.0",
"status": "succeeded",
"error": null,
"created_at": 1779949493,
"updated_at": 1779949593,
"content": {
"video_url": "https://example.com/generated-video.mp4",
"last_frame_url": "https://example.com/last-frame.png"
},
"seed": 0,
"resolution": "720p",
"ratio": "16:9",
"duration": 5,
"framespersecond": 24,
"generate_audio": true,
"service_tier": "default",
"execution_expires_after": 172800,
"usage": {
"completion_tokens": 108900,
"total_tokens": 108900,
"tool_usage": {
"web_search": 0
}
}
}
查询响应字段
| 字段 |
类型 |
说明 |
id |
string |
视频生成任务 ID |
model |
string |
实际使用的模型版本 |
status |
string |
任务状态:queued、running、succeeded、failed、expired、cancelled |
error |
object/null |
失败时返回错误信息,成功或运行中为 null |
created_at |
number |
创建时间,Unix 时间戳秒 |
updated_at |
number |
更新时间,Unix 时间戳秒 |
content.video_url |
string |
生成视频 URL |
content.last_frame_url |
string |
生成视频尾帧 URL,仅在创建时设置 return_last_frame=true 后可能返回 |
seed |
number |
本次任务使用的随机种子 |
resolution |
string |
生成视频分辨率 |
ratio |
string |
生成视频宽高比 |
duration |
number |
生成视频时长,单位秒 |
frames |
number |
生成视频帧数。通常与 duration 二选一返回 |
framespersecond |
number |
生成视频帧率 |
generate_audio |
boolean |
是否包含同步音频 |
service_tier |
string |
实际处理任务使用的服务等级 |
execution_expires_after |
number |
任务超时阈值,单位秒 |
safety_identifier |
string |
创建任务时传入的终端用户唯一标识 |
usage.completion_tokens |
number |
输出视频消耗 token |
usage.total_tokens |
number |
总 token 消耗 |
usage.tool_usage.web_search |
number |
联网搜索实际调用次数 |
状态说明
| 状态 |
说明 |
是否终态 |
queued |
任务排队中 |
否 |
running |
任务执行中 |
否 |
succeeded |
任务成功 |
是 |
failed |
任务失败 |
是 |
expired |
任务超时过期 |
是 |
cancelled |
任务取消 |
是 |
建议首次查询从任务提交后数分钟开始,后续根据业务需要逐步缩短查询间隔。轮询时应在终态后停止。
工具调用
当前支持 web_search 联网搜索工具。
{
"tools": [
{
"type": "web_search"
}
]
}
查询结果中如返回 usage.tool_usage.web_search,表示实际联网搜索次数。
不支持或不建议使用的参数
| 参数 |
说明 |
frames |
当前该渠道按时长生成,不建议使用帧数模式 |
service_tier |
当前不作为创建任务参数转发 |
draft_task |
当前不支持基于样片任务创建正式视频 |
OpenAI 兼容字段 prompt、size |
本接口使用 Seedance Endpoint 格式,请使用 content、resolution、ratio、duration |
注意事项
- 首帧、首尾帧、参考素材属于不同生成方式,尽量不要混用互斥 role。
- 首尾帧模式需要 2 张图片,并分别设置
first_frame 与 last_frame。
- 输入图片、视频、音频应使用公网可访问 URL、Base64 或已入库的
asset://ASSET_ID。
- 生成的视频和尾帧 URL 通常有有效期,建议业务侧及时转存。