curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "seedance-2-5",
"prompt": "电影感产品特写,镜头缓慢推进,保留自然室内声音。",
"duration": 10,
"aspect_ratio": "16:9",
"resolution": "720p",
"generate_audio": true
}'
{
"model": "seedance-2-5",
"prompt": "使用图片1中的人物、视频1的运镜和音频1的节奏。",
"duration": 12,
"aspect_ratio": "16:9",
"image_with_roles": [{"url": "https://example.com/ref.png", "role": "reference_image"}],
"video_with_roles": [{"url": "https://example.com/motion.mp4", "role": "reference_video"}],
"audio_with_roles": [{"url": "https://example.com/rhythm.mp3", "role": "reference_audio"}]
}
{
"model": "seedance-2-5",
"prompt": "向后延长视频1,镜头继续推进并展示窗外的城市。",
"video_operation": "extend",
"duration": 11,
"aspect_ratio": "adaptive",
"output_format": "mov",
"video_with_roles": [{"url": "https://example.com/source.mov", "role": "reference_video"}]
}
{
"id": "tsk_vid_xxx",
"object": "generation.task",
"model": "seedance-2-5",
"status": "in_progress",
"progress": 10,
"created_at": 1781577600
}
seedance-2-5
seedance-2.5 视频生成
使用 seedance-2-5 模型生成视频
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-5",
"prompt": "电影感产品特写,镜头缓慢推进,保留自然室内声音。",
"duration": 10,
"aspect_ratio": "16:9",
"resolution": "720p",
"generate_audio": true
}'
{
"model": "seedance-2-5",
"prompt": "使用图片1中的人物、视频1的运镜和音频1的节奏。",
"duration": 12,
"aspect_ratio": "16:9",
"image_with_roles": [{"url": "https://example.com/ref.png", "role": "reference_image"}],
"video_with_roles": [{"url": "https://example.com/motion.mp4", "role": "reference_video"}],
"audio_with_roles": [{"url": "https://example.com/rhythm.mp3", "role": "reference_audio"}]
}
{
"model": "seedance-2-5",
"prompt": "向后延长视频1,镜头继续推进并展示窗外的城市。",
"video_operation": "extend",
"duration": 11,
"aspect_ratio": "adaptive",
"output_format": "mov",
"video_with_roles": [{"url": "https://example.com/source.mov", "role": "reference_video"}]
}
{
"id": "tsk_vid_xxx",
"object": "generation.task",
"model": "seedance-2-5",
"status": "in_progress",
"progress": 10,
"created_at": 1781577600
}
国内用户请注意: 中国大陆用户请使用
https://toapis.cn 作为接口地址(Base URL)。文档示例中的 https://toapis.com 请替换为 https://toapis.cn。seedance-2-5,火山引擎上游模型 ID 为 doubao-seedance-2-5-260628。
- 支持文生视频、首帧/首尾帧图生视频、视频编辑、视频延长和多模态参考生视频。
- 支持图片、视频、音频参考,也支持纯音频参考。
- 接口为异步任务:提交后返回
generation.task,完成后通过任务状态接口获取视频。
Authorizations
string
必填
所有请求都需要 Bearer Token。请在 API Key 管理页面 获取密钥,并在请求头中添加:
Authorization: Bearer YOUR_API_KEY
Body
string
默认值:"seedance-2-5"
必填
ToAPIs 公共模型名,固定使用
seedance-2-5。string
描述场景、镜头运动、主体动作、风格和声音氛围。引用素材时使用“图片1”“视频1”“音频1”等标签。
string
默认值:"generate"
视频业务类型,可选
generate、edit 或 extend。编辑和延长至少需要一个 video_with_roles;编辑使用 duration=-1,延长使用 4–30 或 -1。三种操作共用本接口。string
客户侧订单号或业务任务 ID。提交后会随任务保存,也可用
GET /v1/videos/generations/{client_business_id} 查询。integer
输出视频时长(秒),范围为
4–30;-1 表示由模型自动选择时长。编辑任务只能使用 -1,输出时长与输入视频基本一致;延长任务可使用 4–30 或 -1,此时按延长后的输出总时长计算。string
可选:
21:9、16:9、4:3、1:1、3:4、9:16、adaptive。编辑、视频延长和首尾帧任务按上游要求使用 adaptive;也可让输入素材决定比例。string[]
兼容模式的图片 URL 数组。新接入建议使用
image_with_roles 明确每张图的用途;两个字段不能同时传。array
带角色的图片数组,每项包含必填
url 和 role。角色可为 first_frame、last_frame 或 reference_image。最多 30 张图片;首尾帧模式与参考图模式不能混用。array
参考视频数组,每项包含必填
url,角色固定为 reference_video。最多 10 段视频。array
参考音频数组,每项包含必填
url,角色固定为 reference_audio。最多 10 段音频,也支持纯音频参考。string
分辨率:
480p、720p 或 1080p。string
默认值:"mp4"
支持
mp4 和 mov。boolean
默认值:true
是否生成同步音频。
boolean
默认值:false
是否在完成结果中返回生成视频的尾帧图片。
array
可选工具:
[{ "type": "web_search" }]。仅适用于纯文生视频,不能与图片、视频或音频输入同时使用。string
ToAPIs 任务完成回调地址,详见任务 Webhook。
string
调用方自定义的链路追踪 ID。
boolean
默认值:false
设为
true 时禁止生成 NSFW 内容。参考素材限制
总计最多 50 个参考素材:图片 30 张、视频 10 段、音频 10 段。请使用显式角色,避免首帧/尾帧与参考素材被错误推断。非法任务组合可能失败。编辑和延长任务会显式指定上游任务类型,特殊限制不符合时在提交阶段立即返回错误;其余任务类型由模型按素材和提示词判断,不符合时在异步阶段失败并返回
InvalidParameter.TaskTypeConstraint。编辑、延长和首尾帧任务按上游要求将 aspect_ratio 设为 adaptive。素材审核
请求带图片, 视频或音频素材时, 部分渠道会在提交生成前自动审核素材. 无需额外参数, 在原有媒体字段中传入素材 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.
- 成稿请求 (
draft_task_id) 不送审. - 旧的
asset://素材引用已停用, 会返回 HTTP 400.
完成后通过视频任务查询获取结果. 启用原始地址交付时优先使用
result.data[].url; 主地址无法访问时, 再使用可选的 fallback_url. 尾帧对应 last_frame_url 和 fallback_last_frame_url, 备用字段仅在副本可用时返回.Response
string
任务 ID,用于查询状态。
string
请求传入该字段时返回。
string
固定为
generation.task。string
本次请求的模型名。
string
queued、in_progress、completed 或 failed。integer
0–100 的任务进度。integer
创建时间戳。
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "seedance-2-5",
"prompt": "电影感产品特写,镜头缓慢推进,保留自然室内声音。",
"duration": 10,
"aspect_ratio": "16:9",
"resolution": "720p",
"generate_audio": true
}'
{
"model": "seedance-2-5",
"prompt": "使用图片1中的人物、视频1的运镜和音频1的节奏。",
"duration": 12,
"aspect_ratio": "16:9",
"image_with_roles": [{"url": "https://example.com/ref.png", "role": "reference_image"}],
"video_with_roles": [{"url": "https://example.com/motion.mp4", "role": "reference_video"}],
"audio_with_roles": [{"url": "https://example.com/rhythm.mp3", "role": "reference_audio"}]
}
{
"model": "seedance-2-5",
"prompt": "向后延长视频1,镜头继续推进并展示窗外的城市。",
"video_operation": "extend",
"duration": 11,
"aspect_ratio": "adaptive",
"output_format": "mov",
"video_with_roles": [{"url": "https://example.com/source.mov", "role": "reference_video"}]
}
{
"id": "tsk_vid_xxx",
"object": "generation.task",
"model": "seedance-2-5",
"status": "in_progress",
"progress": 10,
"created_at": 1781577600
}