正在準備頁面…
▥ Seedance 2.5 正式登場! ›
定價文件最新動態帳號
指南總覽Image APIVideo API
本頁內容生成模式請求範例參數模型任務生命週期Webhooks
資源模型目錄定價API 金鑰Webhook 端點OpenAPI 規格服務狀態產品更新
總覽Image APIVideo API
VIDEO API

生成影片

執行 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。選擇模式即可更新下方的範例。

請求範例

POSThttps://api.mlmux.com/v1/videos/generations
curl 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"
}'

參數

欄位類型必填說明
modelstring是下表中的模型 ID。
promptstring是場景、主體、動作、運鏡、光影及聲音指示。
modestring否text_to_video(預設)、image_to_video、first_last_frame 或 multi_ref。
ratiostring否依各模型支援提供 16:9、9:16、4:3、3:4、1:1、21:9 或 adaptive。預設為 adaptive。
resolutionstring否依各模型支援提供 480p、720p、1080p 或 4K。預設為 720p。
durationinteger否片段長度(秒),需在模型支援的範圍內。預設為 5。使用 -1 可讓模型自動選擇。
generate_audioboolean否隨片段生成同步音訊。
route_modestring否official 或 official-cheap。預設使用金鑰的路由模式,若無則為 official-cheap。
image_urlstring條件式image_to_video 模式必填:起始畫格。
first_frame_url
last_frame_url
string條件式first_last_frame 模式必填。您也可以改為傳送兩個依序排列的 image_urls。
image_urlsstring[]條件式用於 multi_ref 模式的參考圖片。
video_urls
audio_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.5model/seedance-2.5-max480p · 720p · 1080padaptive · 16:9 · 21:9 · 4:3 · 1:1 · 3:4 · 9:164–30 秒
Seedance 2.5 CNmodel/seedance-2.5-cn-max480p · 720p · 1080padaptive · 16:9 · 21:9 · 4:3 · 1:1 · 3:4 · 9:164–30 秒
Seedance 2.0model/seedance-2.0-max480p · 720p · 1080p · 4Kadaptive · 16:9 · 21:9 · 4:3 · 1:1 · 3:4 · 9:164–15 秒
Seedance 2.0 CNmodel/seedance-2.0-cn-max480p · 720p · 1080p · 4Kadaptive · 16:9 · 21:9 · 4:3 · 1:1 · 3:4 · 9:164–15 秒
Seedance 2.0 Fastmodel/seedance-2.0-fast-max480p · 720padaptive · 16:9 · 21:9 · 4:3 · 1:1 · 3:4 · 9:164–15 秒
Seedance 2.0 Fast CNmodel/seedance-2.0-fast-cn-max480p · 720padaptive · 16:9 · 21:9 · 4:3 · 1:1 · 3:4 · 9:164–15 秒
Seedance 2.0 Minimodel/seedance-2.0-mini-max480p · 720padaptive · 16:9 · 21:9 · 4:3 · 1:1 · 3:4 · 9:164–15 秒
Seedance 2.0 Mini CNmodel/seedance-2.0-mini-cn-max480p · 720padaptive · 16:9 · 21:9 · 4:3 · 1:1 · 3:4 · 9:164–15 秒

這些 ID 以 -max 結尾,因此 ratio、resolution 和 duration 為選填,並會回退至上述預設值。

任務生命週期

建立影片時一律會回傳 HTTP 202 及任務物件。請儲存其 id 並輪詢 poll_url。當 status 為 succeeded 時,回應將包含 video、usage 與 actual_charge_credits。

GEThttps://api.mlmux.com/v1/videos/generations/{task_id}
202 Accepted
{
  "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 託管;請下載您想要保留的檔案。

Webhooks

除了輪詢之外,您也可以訂閱 request.succeeded 與 request.failed 事件。承載資料(payload)與簽章驗證方式請參閱 Webhooks。

上一頁Image API下一頁模型目錄