使用自有工具生成影片與圖片
建立金鑰,透過 Bearer 驗證呼叫 API,並持續輪詢任務狀態,直到取得結果。支援 Claude Code、Codex 及任何 HTTP 客戶端。
快速入門
步驟 1
建立金鑰
在您的控制台中生成一組 API 金鑰。該金鑰僅顯示一次,請妥善保管。
步驟 2
呼叫 API
使用您的 Bearer 金鑰與 Idempotency-Key 標頭發送 POST 請求。
步驟 3
結果投票
輪詢任務狀態端點,直到狀態為完成或失敗,然後讀取輸出結果。
身份驗證
每個請求皆透過 Authorization 標頭中的 Bearer API 金鑰進行認證。
Authorization: Bearer sk_live_your_api_key
Content-Type: application/json
Idempotency-Key: a-unique-id-per-requestSeedance 2 Video
文字、圖片或媒體轉換為影片。
提交任務
/api/v1/video/seedance2參數
| 參數 | 類型 | 必填 | 預設 | 允許的值 |
|---|---|---|---|---|
modeGeneration mode. | string | 選填 | text-to-video | text-to-videoimage-to-videomedia-to-video |
quality_tierQuality tier. | string | 選填 | standard | standardpro |
channelRendering channel. | string | 選填 | standard | standardrealwild |
promptText prompt. | string | 必填 | — | 3–10000 chars |
aspect_ratioAspect ratio. | string | 選填 | 16:9 | 1:121:94:33:416:99:16 |
durationClip duration. | string | 選填 | 5 | 4–15 (seconds) |
resolutionOutput resolution. | string | 選填 | 720p | 720p1080p |
image_urlStart frame — required for image-to-video. | string (URL) | 選填 | — | public https URL |
end_image_urlOptional end frame. | string (URL) | 選填 | — | public https URL |
media_urlsRequired for media-to-video. | string[] (URL) | 選填 | — | ≤ 12 public https URLs |
generate_audioGenerate an audio track. | boolean | 選填 | true | truefalse |
fixed_lensLock the camera lens. | boolean | 選填 | false | truefalse |
seedNot supported on the real channel. | integer | 選填 | — | -1 – 4294967295 |
請求
curl -X POST https://seedance2ai.io/api/v1/video/seedance2 \
-H "Authorization: Bearer $SEEDANCE_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: demo-video-001" \
-d '{
"mode": "text-to-video",
"quality_tier": "standard",
"prompt": "A cinematic shot of a glass train crossing a snowy mountain bridge",
"aspect_ratio": "16:9",
"duration": "5",
"resolution": "720p"
}'回應202
{
"id": "sd2_xxxxx",
"status": "processing",
"model": "seedance2",
"quality_tier": "standard",
"channel": "standard",
"credits_used": 30
}檢查任務狀態
/api/v1/tasks/{id}請求
curl https://seedance2ai.io/api/v1/tasks/sd2_xxxxx \
-H "Authorization: Bearer $SEEDANCE_API_KEY"回應200
{
"id": "sd2_xxxxx",
"status": "completed",
"model": "seedance2",
"quality_tier": "standard",
"channel": "standard",
"credits_used": 30,
"credits_refunded": 0,
"output": {
"video_url": "https://...",
"last_frame_url": "https://...",
"seed": 123
},
"error": null,
"created_at": "2026-06-03T10:00:00.000Z",
"updated_at": "2026-06-03T10:03:12.000Z"
}status: processing · completed · failed
錯誤代碼
All errors share this shape:
{ "error": { "code": "invalid_request", "message": "Invalid request body" } }| 代碼 | HTTP | 含義 |
|---|---|---|
unauthorized | 401 | Missing, invalid, or revoked API key. |
invalid_request | 400 | Bad input or unsupported field. |
insufficient_credits | 402 | Not enough credits on the balance. |
rate_limited | 429 | Too many requests — limit is 30 requests per 60 seconds per account. Retry after the Retry-After response header (in seconds). |
idempotency_conflict | 409 | Same Idempotency-Key reused with a different body, or still running. |
service_busy | 503 | Temporary upstream or credit-concurrency issue. Retry. |
not_found | 404 | Task does not exist or does not belong to this key owner. |
internal_error | 500 | Unexpected server-side failure. |
搭配 Claude Code 使用
點擊「複製給 AI」按鈕,即可將完整 API 以乾淨的 Markdown 格式擷取,貼入 Claude Code 或 Codex,讓它自動完成整合對接;或直接將代理指向原始文字端點。
Skill
在 Claude Code、Codex 或任何代理程式中安裝 Seedance 技能 — 它會自動撰寫電影級提示詞,並透過 API 為你生成影片。
# Clone into Claude Code's skills folder
git clone https://github.com/tkaptop/seedance-skill ~/.claude/skills/seedance常見問題
誰可以使用 API?
只要有額度的使用者即可使用。沒有方案限制——任何擁有額度的帳戶都能建立金鑰並呼叫API。
如何獲得點數?
前往定價頁面加值或訂閱,點數將即時存入您的帳戶餘額。
網站與 API 的點數是否共用?
是的,您的個人點數額度同時用於網頁生成和 API 呼叫。在團隊中,API 呼叫使用每位成員的個人額度,而非共享的團隊額度。
如何開始?
在儀表板中建立 API 金鑰,然後使用 Bearer token 呼叫端點(請參閱上方快速入門)。
如果呼叫回傳 insufficient_credits,該如何處理?
您的餘額為零,請前往價格頁面充值後重試。