curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "seedance-2-mini",
"client_business_id": "order_20260616_001",
"prompt": "保持图片1中的人物形象,参考视频1的运镜和音频1的节奏,生成一段室内产品口播短视频。",
"duration": 10,
"aspect_ratio": "16:9",
"image_with_roles": [
{"url": "https://example.com/ref-image-1.jpg", "role": "reference_image"}
],
"video_with_roles": [
{"url": "https://example.com/ref-video-1.mp4", "role": "reference_video"}
],
"audio_with_roles": [
{"url": "https://example.com/ref-audio-1.mp3", "role": "reference_audio"}
],
"resolution": "480p"
}'
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "seedance-2",
"prompt": "镜头从窗边花束慢慢推到餐桌中央,画面色调温暖柔和。",
"duration": 5,
"aspect_ratio": "16:9",
"image_with_roles": [
{"url": "https://example.com/first-frame.png", "role": "first_frame"},
{"url": "https://example.com/last-frame.png", "role": "last_frame"}
],
"resolution": "720p",
"generate_audio": false
}'
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "seedance-2",
"prompt": "微距镜头拍摄一只玻璃蛙停在叶片上,镜头缓慢切到透明腹部与跳动心脏,纪录片风格。",
"duration": 11,
"aspect_ratio": "16:9",
"resolution": "720p",
"generate_audio": true
}'
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "seedance-2-fast",
"prompt": "一只柴犬在雨后的霓虹街头奔跑,地面倒映彩色灯光。",
"duration": 5,
"aspect_ratio": "16:9",
"resolution": "720p"
}'
import requests
response = requests.post(
"https://toapis.com/v1/videos/generations",
headers={
"Authorization": "Bearer your-ToAPIs-key",
"Content-Type": "application/json",
},
json={
"model": "seedance-2-mini",
"prompt": "保持人物形象一致,参考图片和视频的节奏,生成一段简短室内广告视频",
"duration": 8,
"aspect_ratio": "16:9",
"resolution": "720p",
"image_with_roles": [
{"url": "https://example.com/ref.png", "role": "reference_image"}
],
"video_with_roles": [
{"url": "https://example.com/ref.mp4", "role": "reference_video"}
],
},
)
print(response.json())
{
"id": "tsk_vid_xxx",
"client_business_id": "order_20260616_001",
"object": "generation.task",
"model": "seedance-2-mini",
"status": "in_progress",
"progress": 10,
"created_at": 1781577600
}
seedance-2
seedance-2 视频生成
使用 seedance-2、seedance-2-fast 与 seedance-2-mini 模型生成视频
POST
/
v1
/
videos
/
generations
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "seedance-2-mini",
"client_business_id": "order_20260616_001",
"prompt": "保持图片1中的人物形象,参考视频1的运镜和音频1的节奏,生成一段室内产品口播短视频。",
"duration": 10,
"aspect_ratio": "16:9",
"image_with_roles": [
{"url": "https://example.com/ref-image-1.jpg", "role": "reference_image"}
],
"video_with_roles": [
{"url": "https://example.com/ref-video-1.mp4", "role": "reference_video"}
],
"audio_with_roles": [
{"url": "https://example.com/ref-audio-1.mp3", "role": "reference_audio"}
],
"resolution": "480p"
}'
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "seedance-2",
"prompt": "镜头从窗边花束慢慢推到餐桌中央,画面色调温暖柔和。",
"duration": 5,
"aspect_ratio": "16:9",
"image_with_roles": [
{"url": "https://example.com/first-frame.png", "role": "first_frame"},
{"url": "https://example.com/last-frame.png", "role": "last_frame"}
],
"resolution": "720p",
"generate_audio": false
}'
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "seedance-2",
"prompt": "微距镜头拍摄一只玻璃蛙停在叶片上,镜头缓慢切到透明腹部与跳动心脏,纪录片风格。",
"duration": 11,
"aspect_ratio": "16:9",
"resolution": "720p",
"generate_audio": true
}'
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "seedance-2-fast",
"prompt": "一只柴犬在雨后的霓虹街头奔跑,地面倒映彩色灯光。",
"duration": 5,
"aspect_ratio": "16:9",
"resolution": "720p"
}'
import requests
response = requests.post(
"https://toapis.com/v1/videos/generations",
headers={
"Authorization": "Bearer your-ToAPIs-key",
"Content-Type": "application/json",
},
json={
"model": "seedance-2-mini",
"prompt": "保持人物形象一致,参考图片和视频的节奏,生成一段简短室内广告视频",
"duration": 8,
"aspect_ratio": "16:9",
"resolution": "720p",
"image_with_roles": [
{"url": "https://example.com/ref.png", "role": "reference_image"}
],
"video_with_roles": [
{"url": "https://example.com/ref.mp4", "role": "reference_video"}
],
},
)
print(response.json())
{
"id": "tsk_vid_xxx",
"client_business_id": "order_20260616_001",
"object": "generation.task",
"model": "seedance-2-mini",
"status": "in_progress",
"progress": 10,
"created_at": 1781577600
}
国内用户请注意: 中国大陆用户请使用
https://toapis.cn 作为接口地址(Base URL)。文档示例中的 https://toapis.com 请替换为 https://toapis.cn。- 支持
seedance-2、seedance-2-fast与seedance-2-mini - 支持文生视频、首帧/首尾帧图生视频与多模态参考生视频;
seedance-2-mini的首尾帧与音频开关能力也已开放 - 支持参考图、参考视频、参考音频联合控制;
seedance-2-mini最多支持9张图、3条视频、3条音频 - 异步任务管理,提交后返回
generation.task,完成结果通过任务查询接口获取
Authorizations
string
必填
所有接口均需要使用 Bearer Token 进行认证获取 API Key:访问 API Key 管理页面 获取您的 API Key使用时在请求头中添加:
Authorization: Bearer YOUR_API_KEY
Body
string
默认值:"seedance-2"
必填
视频生成模型名称可用模型:
seedance-2- 标准版,适合更高质量输出与更完整的 Seedance 2 能力seedance-2-fast- 快速版,适合预览、迭代和更低延迟场景seedance-2-mini- 轻量版,适合低成本草稿和多模态参考工作流,当前固定单次生成1个结果
string
视频内容描述支持中英文输入。建议明确描述场景、镜头运动、主体动作、风格和声音氛围。建议:
- 中文尽量控制在
500字以内 - 英文尽量控制在
1000词以内 - 需要引用参考素材时,使用“图片1 / 视频1 / 音频1”的方式指代
string
客户侧业务 ID,例如订单号、流水号或您系统内的任务 ID。提交后会随任务保存,后续可用该 ID 查询状态:
GET /v1/videos/generations/{client_business_id}。也兼容放在 metadata.client_business_id 中,但推荐使用顶层字段。integer
默认值:0
视频时长(秒)取值规则:
seedance-2:4-15seedance-2-fast:4-15seedance-2-mini:4-150:自动时长(仅seedance-2/seedance-2-fast)-1:自动时长(仅seedance-2/seedance-2-fast)
string
视频宽高比可选项:
21:916:94:31:13:49:16adaptive
aspect_ratio 作为对外字段。adaptive 表示由上游根据输入素材自动选择合适比例。string[]
兼容模式下的图片 URL 数组推荐优先使用
image_with_roles,这样可以显式声明 first_frame、last_frame 或 reference_image。兼容规则:- 传 1 张图时,通常按首帧图处理
- 传多张图时,角色推断会带来歧义,不建议用于新接入
image_urls不应与image_with_roles同时使用。- 新接入建议使用
image_with_roles显式声明图片用途,避免兼容推断带来的歧义。
array
带角色的图片数组支持场景:
seedance-2/seedance-2-fast/seedance-2-mini- 首帧图生视频:
first_frame1 张 - 首尾帧图生视频:
first_frame1 张 +last_frame1 张 - 多模态参考生视频:
reference_image1-9 张
- 首帧图生视频:
显示 字段说明
显示 字段说明
first_frame最多 1 张last_frame最多 1 张reference_image最多9张- 首帧/首尾帧模式不能与参考模式混用
seedance-2-mini同样支持first_frame、last_frame与reference_image
array
array
string
默认值:"720p"
视频分辨率可选项:
seedance-2:480p、720p、1080p、4kseedance-2-fast:480p、720pseedance-2-mini:480p、720p
boolean
默认值:true
是否生成同步音频
true:生成带音频的视频false:生成无声视频
seedance-2-mini 同样支持该字段。boolean
默认值:false
是否返回生成视频的尾帧图像。设置为
true 后,任务完成时可从状态查询响应的 result.data[0].last_frame_url 获取尾帧图像 URL。array
配置模型可调用的工具。当前 Seedance 2 系列仅支持联网搜索:启用后,模型会根据提示词自主判断是否搜索互联网内容。实际搜索次数通过状态查询响应的
[{ "type": "web_search" }]
usage.tool_usage.web_search 获取,值为 0 表示未执行搜索。tools 仅支持纯文生视频请求,不能与图片、视频或音频输入同时使用。integer
随机种子,用于控制生成随机性
string
ToAPIs 标准任务完成回调地址。必须先在 Token 中配置默认地址和签名密钥;请求级地址仅允许同源覆盖。详见 任务 Webhook。
string
调用方自定义透传 ID调用方追踪字段,与是否启用 Webhook 无关。
boolean
默认值:false
设为
true 时禁止生成 NSFW 内容。素材审核
请求带图片, 视频或音频素材时, 部分渠道会在提交生成前自动审核素材. 无需额外参数, 在原有媒体字段中传入素材 URL 即可.- 请求受理后立即返回视频任务. 需要审核时任务保持
queued, 本次请求的素材全部通过后才提交生成. 首次审核可能需要数分钟, 同一用户在同一渠道重复使用相同 URL 时会复用审核结果. - 每轮素材准备默认最长 20 分钟. 素材被拒绝或准备超时会结束任务, 状态为
failed, 原因见error.message. 审核未通过不收取视频生成费用. - 素材须为公网 HTTP(S) URL, 不接受 Base64 和本地路径. 图片建议不超过 20 MB (部分渠道最高 30 MB), 视频和音频不超过 100 MiB; 各模型原有的格式限制不变.
- 需要审核的渠道会在受理时校验素材: URL 带账号密码或超过 2048 字节, 同一 URL 被用作不同类型, 或单次请求的素材引用超过 64 个时, 直接返回 HTTP 400,
error.code为invalid_private_assets. - 平台按 URL 识别素材. 文件内容变化后请换用新的 URL.
- 旧的
asset://素材引用已停用, 会返回 HTTP 400.
输入组合规则
支持的典型输入组合:- 纯文本:文生视频
- 文本 + 1 张首帧图:首帧图生视频
- 文本 + 首帧图 + 尾帧图:首尾帧图生视频
- 文本 + 参考图:多模态参考生视频
- 文本 + 参考视频:视频参考生视频
- 文本 + 参考图 + 参考音频:多模态参考生视频
- 文本 + 参考图 + 参考视频 + 参考音频:多模态参考生视频
三种模式互斥:
- 首帧图生视频
- 首尾帧图生视频
- 多模态参考生视频
seedance-2-mini 也支持首帧 / 首尾帧模式;需要首尾帧控制时请使用 image_with_roles 显式传入 first_frame / last_frame。能力与约束
| 项目 | seedance-2 | seedance-2-fast | seedance-2-mini |
|---|---|---|---|
| 主要定位 | 更高质量与更长时长 | 更快生成与更低延迟 | 低成本草稿与多模态参考 |
| 时长 | 4-15 秒,支持自动时长 | 4-15 秒,支持自动时长 | 4-15 秒 |
| 分辨率 | 480p / 720p / 1080p / 4k | 480p / 720p | 480p / 720p |
| 图片角色 | first_frame / last_frame / reference_image | first_frame / last_frame / reference_image | first_frame / last_frame / reference_image |
| 视频角色 | reference_video | reference_video | reference_video |
| 音频角色 | reference_audio | reference_audio | reference_audio |
| 首尾帧模式 | 支持 | 支持 | 支持 |
| 参考图上限 | 9 | 9 | 9 |
| 参考视频上限 | 以实际通道能力为准 | 以实际通道能力为准 | 3 |
| 参考音频上限 | 以实际通道能力为准 | 以实际通道能力为准 | 3 |
| 同步音频 | generate_audio | generate_audio | generate_audio |
| ToAPIs 回调 | callback_url(trace_id 可选追踪) | callback_url(trace_id 可选追踪) | callback_url(trace_id 可选追踪) |
seedance-2-mini 当前固定单次生成 1 个结果,不暴露 count / n。首尾帧控制请通过 image_with_roles 的 first_frame / last_frame 表达。完成后通过视频任务查询获取结果. 启用原始地址交付时优先使用
result.data[].url; 主地址无法访问时, 再使用可选的 fallback_url. 尾帧对应 last_frame_url 和 fallback_last_frame_url, 备用字段仅在副本可用时返回.Response
string
任务 ID,用于查询任务状态。
string
客户侧业务 ID。仅当请求中传入
client_business_id 时返回。string
对象类型,固定为
generation.task。string
本次请求使用的模型名称。
string
任务状态:
queued、in_progress、completed 或 failed。integer
任务进度百分比(
0-100)。integer
任务创建时间戳。
提交接口返回的是基础任务对象;当任务完成后,请使用 获取视频任务状态 获取
completed_at、expires_at 以及 result.type = "video" / result.data[].url / result.data[].format。启用 return_last_frame 时,尾帧 URL 位于 result.data[0].last_frame_url;启用 web_search 时,搜索次数位于 usage.tool_usage.web_search。curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "seedance-2-mini",
"client_business_id": "order_20260616_001",
"prompt": "保持图片1中的人物形象,参考视频1的运镜和音频1的节奏,生成一段室内产品口播短视频。",
"duration": 10,
"aspect_ratio": "16:9",
"image_with_roles": [
{"url": "https://example.com/ref-image-1.jpg", "role": "reference_image"}
],
"video_with_roles": [
{"url": "https://example.com/ref-video-1.mp4", "role": "reference_video"}
],
"audio_with_roles": [
{"url": "https://example.com/ref-audio-1.mp3", "role": "reference_audio"}
],
"resolution": "480p"
}'
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "seedance-2",
"prompt": "镜头从窗边花束慢慢推到餐桌中央,画面色调温暖柔和。",
"duration": 5,
"aspect_ratio": "16:9",
"image_with_roles": [
{"url": "https://example.com/first-frame.png", "role": "first_frame"},
{"url": "https://example.com/last-frame.png", "role": "last_frame"}
],
"resolution": "720p",
"generate_audio": false
}'
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "seedance-2",
"prompt": "微距镜头拍摄一只玻璃蛙停在叶片上,镜头缓慢切到透明腹部与跳动心脏,纪录片风格。",
"duration": 11,
"aspect_ratio": "16:9",
"resolution": "720p",
"generate_audio": true
}'
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "seedance-2-fast",
"prompt": "一只柴犬在雨后的霓虹街头奔跑,地面倒映彩色灯光。",
"duration": 5,
"aspect_ratio": "16:9",
"resolution": "720p"
}'
import requests
response = requests.post(
"https://toapis.com/v1/videos/generations",
headers={
"Authorization": "Bearer your-ToAPIs-key",
"Content-Type": "application/json",
},
json={
"model": "seedance-2-mini",
"prompt": "保持人物形象一致,参考图片和视频的节奏,生成一段简短室内广告视频",
"duration": 8,
"aspect_ratio": "16:9",
"resolution": "720p",
"image_with_roles": [
{"url": "https://example.com/ref.png", "role": "reference_image"}
],
"video_with_roles": [
{"url": "https://example.com/ref.mp4", "role": "reference_video"}
],
},
)
print(response.json())
{
"id": "tsk_vid_xxx",
"client_business_id": "order_20260616_001",
"object": "generation.task",
"model": "seedance-2-mini",
"status": "in_progress",
"progress": 10,
"created_at": 1781577600
}