运行 Seedance 2.5, Seedance 2.5 CN, Seedance 2.0, Seedance 2.0 CN, Seedance 2.0 Fast, Seedance 2.0 Fast CN, Seedance 2.0 Mini, Seedance 2.0 Mini CN。每个视频请求都会创建一个任务,您可以通过轮询或 webhook 接收结果。
设置 mode 以选择工作流。默认为 text_to_video。选择模式以更新下方的示例。
https://api.mlmux.com/v1/videos/generationscurl https://api.mlmux.com/v1/videos/generations \
-H "Authorization: Bearer $MLMUX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "model/seedance-2.5-max",
"prompt": "A cinematic tracking shot along a coastal road at sunrise, warm backlight, gentle camera drift",
"mode": "text_to_video",
"ratio": "16:9",
"resolution": "720p",
"duration": 8,
"generate_audio": true,
"route_mode": "official-cheap"
}'| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
model | string | 是 | 下表中的模型 ID。 |
prompt | string | 是 | 描述场景、主体、动作、镜头、光线和声音。 |
mode | string | 否 | text_to_video(默认)、image_to_video、first_last_frame 或 multi_ref。 |
ratio | string | 否 | 16:9、9:16、4:3、3:4、1:1、21:9,模型表中列出时也可用 adaptive。默认为 adaptive。 |
resolution | string | 否 | 根据模型支持情况可选 480p、720p、1080p 或 4K。默认为 720p。 |
duration | integer | 否 | 片段时长(秒),须在模型支持范围内。默认为 5。设为 -1 可由模型自行选择。 |
generate_audio | boolean | 否 | 随视频片段生成同步音频。 |
route_mode | string | 否 | official 或 official-cheap。默认使用 API Key 的路由模式,其次为 official-cheap。 |
image_url | string | 条件必填 | image_to_video 模式下必填:起始帧。 |
first_frame_urllast_frame_url | string | 条件必填 | first_last_frame 模式下必填。也可以改为传入两个按序排列的 image_urls。 |
image_urls | string[] | 条件必填 | 用于 multi_ref 的参考图片。 |
video_urlsaudio_urls | string[] | 条件必填 | 用于 multi_ref 的参考视频和音频。 |
multi_ref 至少需要一个参考文件。Seedance 2.5 最多支持 30 张图片、10 个视频和 10 个音频文件(总共 50 个);其他模型最多支持 9 张图片、3 个视频和 3 个音频文件(总共 12 个)。请使用公开的 https URL,或先通过 POST /v1/uploads 上传文件。
| 模型 | 模型 ID | 分辨率 | 宽高比 | 时长 |
|---|---|---|---|---|
| Seedance 2.5 | model/seedance-2.5-max | 480p · 720p · 1080p | adaptive · 16:9 · 21:9 · 4:3 · 1:1 · 3:4 · 9:16 | 4–30 秒 |
| Seedance 2.5 CN | model/seedance-2.5-cn-max | 480p · 720p · 1080p | adaptive · 16:9 · 21:9 · 4:3 · 1:1 · 3:4 · 9:16 | 4–30 秒 |
| Seedance 2.0 | model/seedance-2.0-max | 480p · 720p · 1080p · 4K | adaptive · 16:9 · 21:9 · 4:3 · 1:1 · 3:4 · 9:16 | 4–15 秒 |
| Seedance 2.0 CN | model/seedance-2.0-cn-max | 480p · 720p · 1080p · 4K | adaptive · 16:9 · 21:9 · 4:3 · 1:1 · 3:4 · 9:16 | 4–15 秒 |
| Seedance 2.0 Fast | model/seedance-2.0-fast-max | 480p · 720p | adaptive · 16:9 · 21:9 · 4:3 · 1:1 · 3:4 · 9:16 | 4–15 秒 |
| Seedance 2.0 Fast CN | model/seedance-2.0-fast-cn-max | 480p · 720p | adaptive · 16:9 · 21:9 · 4:3 · 1:1 · 3:4 · 9:16 | 4–15 秒 |
| Seedance 2.0 Mini | model/seedance-2.0-mini-max | 480p · 720p | adaptive · 16:9 · 21:9 · 4:3 · 1:1 · 3:4 · 9:16 | 4–15 秒 |
| Seedance 2.0 Mini CN | model/seedance-2.0-mini-cn-max | 480p · 720p | adaptive · 16:9 · 21:9 · 4:3 · 1:1 · 3:4 · 9:16 | 4–15 秒 |
这些 ID 以 -max 结尾,因此 ratio、resolution 和 duration 为可选参数,将回退至上述默认值。
创建视频始终返回 HTTP 202 及任务信息。请保存其 id 并轮询 poll_url。当 status 为 succeeded 时,响应中将包含 video、usage 和 actual_charge_credits。
https://api.mlmux.com/v1/videos/generations/{task_id}{
"id": "task_01a9...",
"object": "video.generation.task",
"status": "queued",
"created": 1767225600,
"model": "model/seedance-2.5-max",
"api_method": "videos.generations.create",
"poll_url": "/v1/videos/generations/task_01a9...",
"progress": 0,
"message": "queued",
"estimated_charge_credits": 1.84
}{
"id": "task_01a9...",
"object": "video.generation.task",
"status": "succeeded",
"progress": 100,
"message": "completed",
"video": "https://.../generated/01a9....mp4",
"last_frame_image": "https://.../generated/01a9....jpg",
"usage": {
"output_tokens": 172800,
"video_seconds": 8,
"video_resolution": "720p"
},
"estimated_charge_credits": 1.84,
"actual_charge_credits": 1.79
}失败的任务 status 为 failed,具体原因见 message。输出 URL 由 MLMux 托管,请及时下载需要保留的文件。
除了轮询,您还可以订阅 request.succeeded 和 request.failed 事件。有关 Payload 结构和签名验证,请参阅 Webhook。