使用自有工具生成影片與圖片
建立金鑰,透過 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 Video
文字、圖片或媒體轉換為影片。
/api/v1/video/seedance參數
| 參數 | 類型 | 必填 | 預設 | 允許的值 |
|---|---|---|---|---|
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/seedance \
-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"
}'GPT Image 2
高保真影像生成。
/api/v1/image/gpt-image-2參數
| 參數 | 類型 | 必填 | 預設 | 允許的值 |
|---|---|---|---|---|
typeGeneration type. | string | 必填 | — | text-to-imageimage-to-image |
channelGeneration channel. economy is lower-cost with polling-based delivery. | string | 選填 | standard | standardeconomy |
promptText prompt. | string | 必填 | — | 3–20000 chars |
resolutionOutput resolution. auto only supports 1K; 1:1 cannot use 4K on the standard channel. | string | 必填 | — | 1K2K4K |
aspectRatioAspect ratio. | string | 必填 | — | auto1:15:49:1621:916:94:33:24:53:42:32:11:23:11:39:21 |
batchCountNumber of images. | integer | 選填 | 1 | 1–4 |
imageUrlsRequired for image-to-image. | string[] (URL) | 選填 | — | 1–10 public https URLs |
提交任務
curl -X POST https://seedance2ai.io/api/v1/image/gpt-image-2 \
-H "Authorization: Bearer $SEEDANCE_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: demo-gpt-image-001" \
-d '{
"type": "text-to-image",
"prompt": "Editorial product photo of a transparent running shoe on chrome",
"resolution": "1K",
"aspectRatio": "1:1"
}'Nano Banana Pro
風格化、高品質的圖片輸出
/api/v1/image/nano-banana-pro參數
| 參數 | 類型 | 必填 | 預設 | 允許的值 |
|---|---|---|---|---|
typeGeneration type. | string | 必填 | — | text-to-imageimage-to-image |
promptText prompt. | string | 必填 | — | 3–10000 chars |
image_sizeAspect ratio. | string | 選填 | auto | 1:19:1616:93:44:33:22:35:44:521:9auto |
output_formatImage format. | string | 選填 | png | pngjpeg |
resolutionOutput resolution. | string | 選填 | 1K | 1K2K4K |
image_urlsRequired for image-to-image. | string[] (URL) | 選填 | — | 1–8 public https URLs |
提交任務
curl -X POST https://seedance2ai.io/api/v1/image/nano-banana-pro \
-H "Authorization: Bearer $SEEDANCE_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: demo-nbp-001" \
-d '{
"type": "text-to-image",
"prompt": "A premium packaging mockup for an AI video studio",
"image_size": "1:1",
"resolution": "1K",
"output_format": "png"
}'檢查任務狀態
輪詢直到狀態顯示為完成或失敗。
curl https://seedance2ai.io/api/v1/tasks/sd2_xxxxx \
-H "Authorization: Bearer $SEEDANCE_API_KEY"{
"id": "sd2_xxxxx",
"status": "completed",
"model": "seedance",
"output": { "video_url": "https://..." },
"credits_used": 30
}錯誤代碼
| 代碼 | 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 for this account. |
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. |
Skill
在 Claude Code、Codex 或任何代理程式中安裝 Seedance 技能 — 它會自動撰寫電影級提示詞,並透過 API 為你生成影片。
# Clone into Claude Code's skills folder
git clone https://github.com/tkaptop/seedance-skill ~/.claude/skills/seedance搭配 Claude Code 使用
點擊「複製給 AI」按鈕,即可將完整 API 以乾淨的 Markdown 格式擷取,貼入 Claude Code 或 Codex,讓它自動完成整合對接;或直接將代理指向原始文字端點。
常見問題
誰可以使用 API?
只要有額度的使用者即可使用。沒有方案限制——任何擁有額度的帳戶都能建立金鑰並呼叫API。
如何獲得點數?
前往定價頁面加值或訂閱,點數將即時存入您的帳戶餘額。
網站與 API 的點數是否共用?
是的,您的個人點數額度同時用於網頁生成和 API 呼叫。在團隊中,API 呼叫使用每位成員的個人額度,而非共享的團隊額度。
如何開始?
在儀表板中建立 API 金鑰,然後使用 Bearer token 呼叫端點(請參閱上方快速入門)。
如果呼叫回傳 insufficient_credits,該如何處理?
您的餘額為零,請前往價格頁面充值後重試。