API 参考
文生视频
使用 Seedance 2.0 Open API 通过文本提示词生成视频。
文生视频
使用 Seedance 2.0 Open API 通过文本描述生成视频。当请求中不传 mediaUrls 时,接口会自动按纯文生视频模式处理。
接口地址
POST /api/open/v1/video/generations请求示例
curl --request POST \
--url https://www.seedance2.ink/api/open/v1/video/generations \
--header 'Authorization: Bearer sd2_live_your_api_key' \
--header 'Content-Type: application/json' \
--data '{
"model": "seedance-2.0",
"prompt": "A river flowing through an autumn forest, aerial view, cinematic motion",
"aspectRatio": "16:9",
"duration": 5,
"resolution": "720p",
"webhookUrl": "https://your-app.com/webhooks/seedance",
"metadata": {
"projectId": "proj_1001",
"sceneId": "scene_08"
}
}'成功响应
{
"success": true,
"requestId": "req_1234567890",
"status": "queued",
"creditsCharged": 40
}请求体参数
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | 是 | 可选值:seedance-2.0、seedance-2.0-fast、seedance-1.5-pro。 |
prompt | string | 是 | 用自然语言描述你希望生成的视频内容。 |
aspectRatio | string | 否 | 可选值:16:9、9:16、1:1。 |
duration | integer | 否 | seedance-2.0 和 seedance-2.0-fast 支持 4-15 秒;seedance-1.5-pro 仅支持 5 或 10 秒。 |
resolution | string | 否 | 可选值:480p、720p、1080p。 |
webhookUrl | string | 否 | 任务完成后接收结果回调的地址。 |
metadata | object | 否 | 与本次请求一起保存的自定义元数据,便于业务侧对账或追踪。 |
查询结果
提交成功后,可通过下面的接口轮询任务状态:
curl https://www.seedance2.ink/api/open/v1/video/generations/req_1234567890 \
--header 'Authorization: Bearer sd2_live_your_api_key'成功完成示例:
{
"success": true,
"requestId": "req_1234567890",
"status": "succeeded",
"model": "seedance-2.0",
"prompt": "A river flowing through an autumn forest, aerial view, cinematic motion",
"duration": 5,
"aspectRatio": "16:9",
"output": {
"type": "video",
"url": "https://pub-your-bucket.r2.dev/open-api-results/req_1234567890.mp4"
},
"error": null
}处理中示例:
{
"success": true,
"requestId": "req_1234567890",
"status": "processing",
"model": "seedance-2.0",
"prompt": "A river flowing through an autumn forest, aerial view, cinematic motion",
"duration": 5,
"aspectRatio": "16:9",
"output": null,
"error": null
}失败示例:
{
"success": true,
"requestId": "req_1234567890",
"status": "failed",
"model": "seedance-2.0",
"prompt": "A river flowing through an autumn forest, aerial view, cinematic motion",
"duration": 5,
"aspectRatio": "16:9",
"output": null,
"error": {
"code": "provider_error",
"message": "Video generation failed upstream"
}
}取消任务
你可以通过下面的接口取消排队中或生成中的任务:
curl --request POST \
--url https://www.seedance2.ink/api/open/v1/video/generations/req_1234567890/cancel \
--header 'Authorization: Bearer sd2_live_your_api_key'{
"success": true,
"requestId": "req_1234567890",
"status": "cancelled"
}说明
creditsCharged会在任务提交成功时计算并返回。- 只有当
status为succeeded时,响应中才会出现output.url。 - 如果你希望在任务完成时被动接收通知,建议配置 Webhook。
- 如果你需要基于图片或其他参考素材生成,请查看 图生视频。