推荐模型:Seedance 2.5( doubao-seedance-2-5)
OpenAI 兼容端点:POST /v1/video/generations
官方 content 走:/api/v3/contents/generations/tasks
4–30 秒,或 -1(模型自选)480p / 720p / 1080p| 场景 | 请求参数 | Seedance 2.5 约束 |
|---|---|---|
| 文生视频 | 仅需 prompt | 无特殊限制 |
| 首帧/首尾帧 | images,支持 first_frame、last_frame | ratio 建议使用 adaptive |
| 参考生视频 | reference_*、omni_reference_task_type=auto | 参考视频建议 4-30 秒 |
| 视频编辑 | reference_video、omni_reference_task_type=edit | ratio=adaptive,duration=-1 |
| 视频延长 | reference_video、omni_reference_task_type=extend | ratio=adaptive,时长 4-30 秒或 -1 |
POST https://api.token5u.cn/v1/videos
Authorization: Bearer <你的apikey>
Content-Type: application/jsoncurl -X POST "https://api.token5u.cn/v1/videos"
-H "Authorization: Bearer <你的apikey>"
-H "Content-Type: application/json"
-d '{
"model": "Doubao-Seedance-2.0",
"prompt": "一只穿红大衣的小猫在雪地里抓雪花,电影微距",
"seconds": "5",
"metadata": {
"resolution": "480p",
"ratio": "9:16",
"generate_audio": true
}
}'480p / 720p / 1080pcurl -X POST "https://api.token5u.cn/v1/videos" \
-H "Authorization: Bearer <你的apikey>" \
-H "Content-Type: application/json" \
-d '{
"model": "Doubao-Seedance-2.0",
"prompt": "一只穿红大衣的小猫在雪地里抓雪花,电影微距",
"seconds": "5",
"metadata": {
"content": [
{
"type": "image_url",
"image_url": {
"url": "https://example.com/first.png"
},
"role": "first_frame"
},
{
"type": "image_url",
"image_url": {
"url": "https://example.com/last.png"
},
"role": "last_frame"
}
],
"resolution": "480p",
"ratio": "16:9",
"generate_audio": true
}
}'curl -X POST "https://api.token5u.cn/v1/videos" \
-H "Authorization: Bearer <你的apikey>" \
-H "Content-Type: application/json" \
-d '{
"model": "Doubao-Seedance-2.0",
"prompt": "角色跟参考图一致,动作跟参考视频,节奏贴合参考音频",
"seconds": "5",
"metadata": {
"content": [
{
"type": "image_url",
"image_url": {
"url": "https://example.com/char.png"
},
"role": "reference_image"
},
{
"type": "video_url",
"video_url": {
"url": "https://example.com/motion.mp4"
},
"role": "reference_video"
},
{
"type": "audio_url",
"audio_url": {
"url": "https://example.com/bgm.mp3"
},
"role": "reference_audio"
}
],
"ratio": "16:9",
"resolution": "480p",
"generate_audio": true
}
}'curl -X POST "https://api.token5u.cn/v1/videos" \
-H "Authorization: Bearer <你的apikey>" \
-H "Content-Type: application/json" \
-d '{
"model": "Doubao-Seedance-2.0",
"prompt": "将外套改为红色,构图与运镜不变",
"metadata": {
"content": [
{
"type": "video_url",
"video_url": {
"url": "https://example.com/motion.mp4"
},
"role": "reference_video"
}
],
"ratio": "adaptive",
"resolution": "480p",
"duration": -1,
"generate_audio": true,
"omni_reference_task_type": "edit",
"output_format": "mov"
}
}'curl -X POST "https://api.token5u.cn/v1/videos" \
-H "Authorization: Bearer <你的apikey>" \
-H "Content-Type: application/json" \
-d '{
"model": "Doubao-Seedance-2.0",
"prompt": "延续故事,人物继续走入街道",
"seconds": "5",
"metadata": {
"content": [
{
"type": "video_url",
"video_url": {
"url": "https://example.com/clip.mp4"
},
"role": "reference_video"
}
],
"ratio": "adaptive",
"resolution": "480p",
"generate_audio": true,
"omni_reference_task_type": "extend",
"output_format": "mov"
}
}'
omni_reference_task_type:auto:按提示词自动判断,不符限制时异步报错。edit / extend:提交时前置校验。output_format:mp4(默认,兼容性好)mov(编辑、延长推荐,后期调色用)web_search、watermark、return_last_frame、seed、camera_fixedcontent,则整包透传,不要再叠加 prompt/images。{
"id": "task_gwU1eA************bQAvDzRrL",
"task_id": "task_gwU1eA************bQAvDzRrL",
"object": "video",
"model": "Doubao-Seedance-2.0",
"status": "queued",
"progress": 0,
"created_at": 1787145328
}curl "https://api.token5u.cn/v1/videos/task_gwU1eA************bQAvDzRrL" \
-H "Authorization: Bearer YOUR_API_KEY"| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | 是 | 推荐 doubao-seedance-2-5 |
prompt | string | 是 | 画面 / 编辑 / 延长意图 |
images / image_urls | array | 否 | URL 或 {url, role}:first_frame / last_frame / reference_image |
videos | array | 否 | {url, role: "reference_video"} |
audios | array | 否 | {url, role: "reference_audio"};2.5 可仅音频 |
resolution | string | 否 | 2.5:480p / 720p / 1080p |
ratio | string | 否 | 21:9 / 16:9 / 4:3 / 1:1 / 3:4 / 9:16 / adaptive |
duration | integer | 否 | 2.5:4–30 或 -1(模型自选) |
omni_reference_task_type | string | 否 | 全模态任务类型:auto / edit / extend。edit/extend 提交时校验;auto 不符限制则异步报错 |
output_format | string | 否 | mp4(默认)/ mov(编辑、延长推荐) |
generate_audio | boolean | 否 | 是否出音轨 |
watermark | boolean | 否 | 水印 |
return_last_frame | boolean | 否 | 结果带回尾帧图 |
web_search | boolean | 否 | 联网搜索 |
seed | integer | 否 | 随机种子 |
camera_fixed | boolean | 否 | 锁定镜头 |
content | array | 否 | 官方多模态数组,有则直通 |
role 与 type 等价。参数错误、模型不存在、模型名称拼写错误、JSON 格式错误或缺少必填字段时返回。
{
"error": {
"message": "The model does not exist or you do not have access to it.",
"type": "invalid_request_error",
"param": "model",
"code": "model_not_found"
}
}{
"error": {
"message": "Invalid API Key or authorization header. Please check your credentials.",
"type": "invalid_request_error",
"param": null,
"code": "invalid_api_key"
}
}json Authorization: Bearer sk-xxx {
"error": {
"message": "Your credit balance is insufficient. Please recharge your account.",
"type": "insufficient_quota",
"param": null,
"code": "insufficient_quota"
}
}