Seedance 影片生成 (詳細)

Seedance 全系列深度參數: 首尾幀 / 參考影片 / 參考圖 / 音訊生成 / Draft 模式 / Seed 復現

POST /v1/videos/generations

鉴权: {'type': 'bearer', 'prefix': 'sk-', 'description': 'API Key, 使用 `Authorization: Bearer sk-xxx` 鉴权'}

## Seedance 系列完整參數手冊 字節 Seedance 影片生成 — **BytePlus 原生用法**, 跟官方文件 100% 一致. > ✦ **協議透明**: 我們的 endpoint 直接 BytePlus 原生 body 透傳 + response 原樣返客戶, 0 欄位魔改 / 0 協議轉換. 欄位語義 / 預設值 / 錯誤碼 全部參考 [BytePlus 官方文件](https://docs.byteplus.com/en/docs/ModelArk/2291680). ## 模型矩陣 影片時長**統一支援 4-15 秒**, 各模型實際上限略有不同 (超出上游 400): | 模型 | 典型場景 | 解析度 | 音訊 | Draft | V2V | |---|---|---|---|---|---| | `dreamina-seedance-2-0-260128` | 頂級品質 + 影片續寫 | 480 / 720 / 1080p | ✅ | ❌ | ✅ | | `dreamina-seedance-2-0-fast-260128` | 快速出片 | 480 / 720p | ✅ | ❌ | ❌ | | `dreamina-seedance-2-0-mini-260615` | 輕量經濟 | 480 / 720p | ✅ | ❌ | ✅ | | `seedance-1-5-pro-251215` | Draft 預覽+精修 | 480 / 720 / 1080p | ✅ | ✅ | ❌ | | `seedance-1-0-pro-250528` | 旗艦平衡 | 480 / 720 / 1080p | ❌ | ❌ | ❌ | | `seedance-1-0-pro-fast-251015` | 經濟快速 | 480 / 720p | ❌ | ❌ | ❌ | 具體每個模型的 duration 上限 / 支援的 ratio / 音訊位元速率參數見 [BytePlus 官方文件](https://docs.byteplus.com/en/docs/ModelArk/2291680). ## 輸入方式 — content[] 陣列 BytePlus 原生 `content` 陣列支援 5 種 block type, 靈活組合實現 T2V / I2V / V2V / A2V / Draft: ```json "content": [ { "type": "text", "text": "一隻貓在海邊奔跑, 慢鏡頭, 黃昏光" }, { "type": "image_url", "image_url": { "url": "https://...", "role": "first_frame" } }, { "type": "image_url", "image_url": { "url": "https://...", "role": "last_frame" } }, { "type": "video_url", "video_url": { "url": "https://...", "role": "reference_video" } }, { "type": "audio_url", "audio_url": { "url": "https://..." } }, { "type": "draft_task","draft_task":{ "task_id": "gt_xxx" } } ] ``` | Block | 用法 | 適用模型 | |---|---|---| | `text` | 文本提示詞 (T2V 必填) | 全系 | | `image_url` role=`first_frame` / `last_frame` / `reference_image` | 圖生影片 / 首尾幀 / 參考圖 | 全系支援 | | `video_url` role=`reference_video` | V2V 影片續寫 | Seedance 2.0 | | `audio_url` | A2V 音訊生影片 | Seedance 2.0 | | `draft_task` task_id | Draft 續推 (基於之前 task) | Seedance 1.5 Pro | ## 非同步呼叫流程 ``` 1. POST /v1/videos/generations → 立即返 { id: "gt_xxx", status: "processing" } 2. GET /v1/videos/generations/{id} → 輪詢直到 status=succeeded 3. response.content[].video_url → 影片 URL (BytePlus 上游簽名 URL) ``` ## 詳細欄位說明 (跟 BytePlus 官方對齊) 下方 Request body 欄位表是從官方文件摘取的核心欄位. **完整欄位 / 邊界條件 / 錯誤碼列表請以 [BytePlus ModelArk 官方文件](https://docs.byteplus.com/en/docs/ModelArk/2291680) 為準**.

请求体

modelstringrequiredSeedance 模型 ID. 全部 5 個變體: - dreamina-seedance-2-0-260128 (頂級, 支援 V2V/A2V) - dreamina-seedance-2-0-fast-260128 (快速) - seedance-1-5-pro-251215 (Draft 預覽) - seedance-1-0-pro-250528 (旗艦平衡) - seedance-1-0-pro-fast-251015 (經濟快速) - dreamina-seedance-2-0-mini-260615 (輕量經濟, 支援 V2V)
contentarrayBytePlus 原生輸入陣列 (推薦主用法). 5 種 type (注意 `role` 跟 `type` 同級放在 content item 外層, 不進 `image_url`/`video_url` 子物件): - text: `{ type:"text", text:"..." }` 文本提示詞 - image_url: `{ type:"image_url", image_url:{ url }, role:"first_frame"|"last_frame"|"reference_image" }` 圖生影片 - video_url: `{ type:"video_url", video_url:{ url }, role:"reference_video" }` 影片續寫 (Seedance 2.0) - audio_url: `{ type:"audio_url", audio_url:{ url } }` 音訊生影片 (Seedance 2.0 A2V) - draft_task: `{ type:"draft_task", draft_task:{ task_id } }` Draft 續推 (Seedance 1.5 Pro) 如果不傳, endpoint 會從.
durationinteger影片時長 (秒). 統一範圍 4-15s, 各模型實際上限不同 (超出時上游返 400). 具體見 [BytePlus 官方文件](https://docs.byteplus.com/en/docs/ModelArk/2291680)
resolutionstring解析度
ratiostringBytePlus 原生寬高比
generate_audioboolean生成同步音訊 (BytePlus 原生欄位). 僅 Seedance 2.0 / 2.0 Fast / 1.5 Pro 支援
draftbooleanDraft 快速預覽模式 (BytePlus 原生欄位). 僅 Seedance 1.5 Pro 支援. 開啟後費用降低 ~30%, 出粗剪用於參數驗證
seedinteger隨機種子 (0~2^32-1), 固定後同 prompt 可復現相似影片
camera_fixedboolean鏡頭鎖定 (不做運鏡), 適合靜態主體場景.
watermarkboolean新增平臺水印 (預設 false)
return_last_frameboolean返回末幀圖片 URL (用作下一段續寫首幀)
framesinteger幀數 (BytePlus 高階參數, 一般 duration 自動推算, 不需手動傳)
callback_urlstringBytePlus 任務終態回呼 URL. 任務成功 / 失敗時, BytePlus 上游**直接** POST 到此地址 (繞開平臺 webhook). 客戶用 HTTPS 域名, 自己處理簽名校驗. 詳見 [BytePlus 官方文件](https://docs.byteplus.com/en/docs/ModelArk/2291680)
execution_expires_afterinteger任務過期時間 (秒). 預設 172800 (48 小時, 跟 BytePlus 上限對齊). 超時後任務自動 expired, 終態可正常查詢
safety_identifierstring客戶標識 (跟 OpenAI `user` 欄位類似), 用於 BytePlus 內容稽核回溯. 推薦傳客戶內部使用者 ID 的 hash. 不參與計費, 僅審計用
prioritystring任務優先順序. BytePlus 高階參數, 預設按 standard 佇列處理. 詳見 [BytePlus 官方文件](https://docs.byteplus.com/en/docs/ModelArk/2291680)
waitbooleantrue=阻塞模式 (最長 60s 同步等結果), false=非同步立即返回 task_id (推薦)

响应

调用示例

curl -X POST https://api.router.ai/v1/videos/generations \
  -H "Authorization: Bearer $YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "dreamina-seedance-2-0-260128",
    "content": [
      { "type": "text", "text": "@Image1, @Video1, 参考剧情和动作, 把人物换成猫" },
      { "type": "image_url", "image_url": { "url": "https://example.com/cat.jpg" }, "role": "reference_image" },
      { "type": "video_url", "video_url": { "url": "https://example.com/clip.mp4" }, "role": "reference_video" }
    ],
    "ratio": "adaptive",
    "duration": 10,
    "resolution": "720p",
    "generate_audio": true
  }'

## 錯誤處理 | HTTP 狀態碼 | 錯誤類型 | 描述 | |---|---|---| | 400 | `InvalidParameter` | 參數錯誤 | | 400 | `InvalidParameter.MissingRequired` | 必填欄位未提供 (e.g. prompt / model / content[]) | | 400 | `InvalidParameter.NotInEnum` | 列舉值非法 (resolution / aspect_ratio / role 等) | | 400 | `InvalidParameter.UnsupportedImageFormat` | 圖片格式不支援 | | 400 | `InvalidParameter.UnsupportedVideoFormat` | 影片格式不支援 | | 400 | `InvalidParameter.UnsupportedAudioFormat` | 音訊格式不支援 | | 400 | `InvalidParameter.ImageSizeTooLarge` | 圖片體積超上游單檔案限制 | | 400 | `InvalidParameter.VideoSizeTooLarge` | 輸入影片體積超限 | | 400 | `InvalidParameter.VideoDurationTooLong` | 輸入影片時長超上限 | | 400 | `InvalidParameter.PromptTooLong` | prompt 字元數超模型上限 | | 400 | `InvalidParameter.UrlNotAccessible` | 上游下載客戶提供的 image_url/video_url 失敗 | | 400 | `InvalidParameter.UrlInvalid` | URL 格式非法 (非 http(s) / 字元錯) | | 400 | `InvalidParameter.AspectRatioMismatch` | aspect_ratio 與輸入圖比例不一致 | | 400 | `InvalidParameter.ResolutionNotSupported` | 該模型不支援指定 resolution | | 400 | `InvalidParameter.DurationOutOfRange` | duration 超模型支援範圍 | | 400 | `InvalidParameter.ContentEmpty` | prompt / content[] 全空 | | 400 | `InvalidParameter.UnsupportedRole` | content[].role 非法 | | 400 | `InvalidParameter.DataInspectionFailed` | 輸入資料規格檢查失敗 (跟內容稽核不同維度) | | 400 | `DataInspectionFailed` | 同上無字首變體 | | 400 | `InputImageSensitiveContentDetected` | 輸入圖片包含敏感內容 (主類) | | 400 | `InputTextSensitiveContentDetected` | prompt 包含敏感內容 (主類, 子分類同 Image) | | 400 | `InputVideoSensitiveContentDetected` | 輸入影片包含敏感內容 | | 400 | `InputAudioSensitiveContentDetected` | 輸入音訊包含敏感內容 | | 400 | `invalid_request_error` | 平臺參數校驗失敗 (模型類型不匹配 / 必填欄位缺失等) | | 401 | `unauthorized` | 無效或缺失. 檢查 Bearer sk-xxx header | | 402 | `insufficient_balance` | 餘額不足, 充值後重試 | | 403 | `permission_denied` | 模型未授權 / Token 被禁 / Token 過期 | | 404 | `model_not_found` | 模型名拼錯或已下架 | | 404 | `ResourceNotFound` | 任務 ID 不存在或已過 BytePlus 7-8 天保留期被清理 | | 409 | `idempotency_conflict` | 同請求短時間重複提交, 等幾秒重試或修改參數 | | 429 | `rate_limit_exceeded` | RPM/TPM 限流, 看 `Retry-After` header 退避 | | 429 | `RateLimitExceeded` | 上游限流 | | 429 | `Throttling` | 上游限流, 同 RateLimitExceeded | | 429 | `ConcurrencyExceeded` | 單時刻併發超 max_concurrent, 減少併發 | | 500 | `internal_error` | 平臺服務端錯 | | 500 | `InternalError` / `InternalServerError` | 上游內部錯, 同上重試策略 | | 502 | `service_unavailable` | 上游通道全不可用 | | 502 | `BadGateway` | 上游閘道器錯 | | 503 | `ServiceUnavailable` | 上游服務暫不可達 | | 504 | `RequestTimeout` / `ModelTimeoutException` | 上游推理超時 |

API 文件