API 參考
API 總覽
了解 Seedance 2.0 Open API 的認證方式、提交流程、狀態查詢與 Webhook 回調。
Seedance 2.0 Open API 支援你從自己的產品中非同步提交影片生成任務,並在處理完成後取得結果。
Base URL
https://www.seedance2.inkAuthentication
所有 Open API 請求都使用在 Seedance 控制台建立的 Bearer Token。
Authorization: Bearer sd2_live_your_api_key{
"success": false,
"error": {
"code": "unauthorized",
"message": "Invalid API key"
}
}接入流程
- 在 Seedance 控制台建立 API Key。
- 使用
POST /api/open/v1/video/generations提交生成任務。 - 保存回傳的
requestId。 - 輪詢
GET /api/open/v1/video/generations/{requestId}直到任務完成。 - 如有需要,可用 Webhook 接收完成通知。
核心介面
| Method | Endpoint | Description |
|---|---|---|
GET | /api/open/v1/models | 取得可用模型、時長、比例、解析度與計費資訊。 |
POST | /api/open/v1/video/generations | 建立新的影片生成任務。 |
GET | /api/open/v1/video/generations/{requestId} | 查詢任務狀態,並在完成後取得輸出影片地址。 |
POST | /api/open/v1/video/generations/{requestId}/cancel | 取消仍在排隊或處理中的任務。 |
Available Models
| Model | Best for | Supported durations | Resolutions |
|---|---|---|---|
seedance-2.0 | Highest quality, multimodal generation | 4-15 seconds | 480p, 720p, 1080p |
seedance-2.0-fast | Faster turnaround | 4-15 seconds | 480p, 720p, 1080p |
seedance-1.5-pro | Lower-cost fallback workloads | 5 or 10 seconds | 480p, 720p, 1080p |
Supported aspect ratios:
16:99:161:1
狀態值
| Status | Description |
|---|---|
queued | 請求已接受,正在排隊。 |
processing | 任務正在生成中。 |
succeeded | 任務已成功完成,output.url 可用。 |
failed | 任務失敗,請查看 error 欄位。 |
cancelled | 任務在完成前已取消。 |
Models Endpoint Example
curl https://www.seedance2.ink/api/open/v1/models{
"success": true,
"data": [
{
"id": "seedance-2.0",
"type": "video_generation",
"mode": "image_to_video",
"durations": [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
"aspectRatios": ["16:9", "9:16", "1:1"],
"resolutions": ["480p", "720p", "1080p"],
"usdPerSecond": {
"480p": 0.05,
"720p": 0.1,
"1080p": 0.2
}
}
]
}Webhook
你可以在單次請求中傳入 webhookUrl,也可以在 API Key 層級設定預設回調地址。
- 若兩者同時存在,單次請求中的
webhookUrl優先。 - 如果 API Key 設定了 Webhook Secret,回調請求會附帶
x-seedance-signature。 - Webhook 僅在任務進入終態時送出。
x-seedance-signature: <hex_sha256_hmac>{
"success": true,
"requestId": "req_1234567890",
"status": "succeeded",
"output": {
"type": "video",
"url": "https://pub-your-bucket.r2.dev/open-api-results/req_1234567890.mp4"
},
"error": null
}錯誤碼
| HTTP status | Error code | Description |
|---|---|---|
400 | invalid_request | 請求體不符合介面要求。 |
401 | unauthorized | API Key 缺失或無效。 |
402 | insufficient_credits | 帳戶點數不足,無法建立任務。 |
404 | not_found | 目前 API Key 下找不到對應任務。 |
429 | rate_limited | 超出每分鐘限制或月度配額。 |
500 | internal_error | 伺服器發生未預期錯誤。 |