執行 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。預設使用金鑰的路由模式,若無則為 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)與簽章驗證方式請參閱 Webhooks。