公共 API

使用自有工具生成影片與圖片

建立金鑰,透過 Bearer 驗證呼叫 API,並持續輪詢任務狀態,直到取得結果。支援 Claude Code、Codex 及任何 HTTP 客戶端。

管理金鑰

快速入門

步驟 1

建立金鑰

在您的控制台中生成一組 API 金鑰。該金鑰僅顯示一次,請妥善保管。

步驟 2

呼叫 API

使用您的 Bearer 金鑰與 Idempotency-Key 標頭發送 POST 請求。

步驟 3

結果投票

輪詢任務狀態端點,直到狀態為完成或失敗,然後讀取輸出結果。

身份驗證

每個請求皆透過 Authorization 標頭中的 Bearer API 金鑰進行認證。

http
Authorization: Bearer sk_live_your_api_key
Content-Type: application/json
Idempotency-Key: a-unique-id-per-request

Seedance 2 Video

文字、圖片或媒體轉換為影片。

1

提交任務

POST
/api/v1/video/seedance2

參數

參數類型必填預設允許的值
mode

Generation mode.

string選填text-to-video
text-to-videoimage-to-videomedia-to-video
quality_tier

Quality tier.

string選填standard
standardpro
channel

Rendering channel.

string選填standard
standardrealwild
prompt

Text prompt.

string必填
3–10000 chars
aspect_ratio

Aspect ratio.

string選填16:9
1:121:94:33:416:99:16
duration

Clip duration.

string選填5
4–15 (seconds)
resolution

Output resolution.

string選填720p
720p1080p
image_url

Start frame — required for image-to-video.

string (URL)選填
public https URL
end_image_url

Optional end frame.

string (URL)選填
public https URL
media_urls

Required for media-to-video.

string[] (URL)選填
≤ 12 public https URLs
generate_audio

Generate an audio track.

boolean選填true
truefalse
fixed_lens

Lock the camera lens.

boolean選填false
truefalse
seed

Not supported on the real channel.

integer選填
-1 – 4294967295

請求

bash
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

json
{
  "id": "sd2_xxxxx",
  "status": "processing",
  "model": "seedance2",
  "quality_tier": "standard",
  "channel": "standard",
  "credits_used": 30
}
2

檢查任務狀態

GET
/api/v1/tasks/{id}

請求

bash
curl https://seedance2ai.io/api/v1/tasks/sd2_xxxxx \
  -H "Authorization: Bearer $SEEDANCE_API_KEY"

回應200

json
{
  "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:

json
{ "error": { "code": "invalid_request", "message": "Invalid request body" } }
代碼HTTP含義
unauthorized401Missing, invalid, or revoked API key.
invalid_request400Bad input or unsupported field.
insufficient_credits402Not enough credits on the balance.
rate_limited429Too many requests — limit is 30 requests per 60 seconds per account. Retry after the Retry-After response header (in seconds).
idempotency_conflict409Same Idempotency-Key reused with a different body, or still running.
service_busy503Temporary upstream or credit-concurrency issue. Retry.
not_found404Task does not exist or does not belong to this key owner.
internal_error500Unexpected server-side failure.

搭配 Claude Code 使用

點擊「複製給 AI」按鈕,即可將完整 API 以乾淨的 Markdown 格式擷取,貼入 Claude Code 或 Codex,讓它自動完成整合對接;或直接將代理指向原始文字端點。

Skill

在 Claude Code、Codex 或任何代理程式中安裝 Seedance 技能 — 它會自動撰寫電影級提示詞,並透過 API 為你生成影片。

bash
# 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,該如何處理?

您的餘額為零,請前往價格頁面充值後重試。