SeeDance Videos Generation API 串接說明
本文將介紹一種 SeeDance Videos Generation API 串接方式,可以透過輸入自訂參數來生成 SeeDance 官方影片。
¶ 申請流程
要使用 SeeDance Videos Generation API,首先到 零壹AI 控制台 取得您的 API Token,留作備用。

如果您尚未登入或註冊,系統會自動跳轉到登入頁面,邀請您註冊和登入,完成後會自動返回目前頁面。
通用應用程式的 API Key 可用於帳號已開放的服務;專用應用程式的 Key 按該應用程式的服務範圍使用。請檢查 Key 的權限、有效期和限額,並確認應用程式餘額足以支付本次請求。可用試用額度以帳號顯示為準,餘額不足時點擊「儲值」按鈕即可。
¶ 基本使用
首先先了解一下基本的使用方式,就是輸入提示詞 content.text、類型 content.type=text 以及模型 model,便可取得處理後的結果,具體內容如下:

可以看到這裡我們設定了請求標頭(Request Headers),包括:
accept:想要接收什麼格式的回應結果,這裡填寫為application/json,即 JSON 格式。authorization:呼叫 API 的金鑰,申請之後可以直接下拉選擇。
另外設定了請求本文(Request Body),包括:
model:生成影片的模型。- Seedance 1.x 系列:
doubao-seedance-1-0-pro-250528、doubao-seedance-1-0-pro-fast-251015、doubao-seedance-1-5-pro-251215、doubao-seedance-1-0-lite-t2v-250428、doubao-seedance-1-0-lite-i2v-250428。 - Seedance 2.0 系列(支援角色和影音多模態參考):
doubao-seedance-2-0-260128(標準)、doubao-seedance-2-0-fast-260128(快速)、doubao-seedance-2-0-mini-260615(輕量)。 - Seedance 2.5:
doubao-seedance-2-5-260628,支援最長 30 秒、純音訊參考、更多素材、影片編輯與延長。
- Seedance 1.x 系列:
content:輸入內容陣列,type可以是text(提示詞)、image_url(參考圖片)、audio_url(參考音訊)、video_url(參考影片)。圖片可透過role指定用途:first_frame(首影格)/last_frame(尾影格)/reference_image(角色 / 主體參考)。resolution:輸出解析度,可選480p/720p/1080p/4k。2.5 支援 480p、720p、1080p;2.0 Fast/Mini 支援 480p、720p;2.0 Standard 最高支援 4k。ratio:寬高比,可選16:9/4:3/1:1/3:4/9:16/21:9/adaptive。duration:影片時長(秒,整數)。1.0 系列 2–12;1.5 Pro 4–12;2.0 系列 4–15;2.5 為 4–30。1.5/2.x 支援-1(自動時長)。seed:隨機種子,整數,-1 到 4294967295。camerafixed:是否固定攝影機,true/false。watermark:是否新增浮水印,true/false。generate_audio:是否生成有聲影片,true/false,Seedance 1.5 Pro 與 2.x 系列支援。return_last_frame:是否在結果中回傳影片最後一個影格的圖片 URL。omni_reference_task_type:僅 2.5;auto/reference/edit/extend。output_format:僅 2.5;mp4/mov,預設mp4。tools:僅 2.5;目前支援web_search聯網搜尋工具,可限制結果數、關鍵字數和搜尋來源。priority:2.5 可選任務優先順序,整數 0–9,預設 0。safety_identifier:最長 64 字元的穩定匿名終端使用者識別碼;請使用雜湊值或內部匿名 ID,不要傳入姓名、電子郵件地址或手機號碼。execution_expires_after:任務逾時時間(秒),範圍 3600–259200。callback_url:非同步回呼網址,設定後 API 立即回傳task_id,任務完成時將結果以 POST 傳送到該網址。async:可選,設為true時介面立即回傳task_id,無須提供callback_url,隨後透過對應的任務查詢介面輪詢取得結果。
選擇之後,可以發現右側也生成了對應程式碼,如圖所示:

點擊「Try」按鈕即可進行測試,如上圖所示,這裡我們就得到了如下結果:
{
"success": true,
"task_id": "9777f36b-4f44-47ff-962d-45cd2f7aeaa8",
"trace_id": "ce5da2ca-6695-4459-9d2c-2ef9f86db752",
"data": {
"task_id": "7e4e1773-510a-4a73-9ab4-98dd1a0b2a7f",
"status": "succeeded",
"model": "doubao-seedance-2-0-fast-260128",
"duration": 5,
"resolution": "720p",
"ratio": "16:9",
"video_url": "https://cdn.acedata.cloud/assets/examples/seedance/036f24ed-a9b1-49b3-92c4-30049a3bc152-102bf9f98e35.mp4"
}
}
回傳結果一共有多個欄位,介紹如下:
success,此時影片生成任務的狀態情況。task_id,此時影片生成任務 ID。trace_id,此時影片生成追蹤 ID。data,此時影片生成任務的結果列表。task_id,此時影片生成任務的伺服器端 ID。video_url,此時影片生成任務的影片連結。status,此時影片生成任務的狀態。model,生成影片使用的模型。
可以看到我們得到了滿意的影片資訊,我們只需要根據結果中 data 的影片連結網址取得生成的 SeeDance 影片即可。
另外如果想生成對應的串接程式碼,可以直接複製生成的程式碼,例如 CURL 的程式碼如下:
curl -X POST 'https://api.01ai.cloud/seedance/videos' \
-H 'authorization: Bearer ${bearer_token}' \
-H 'accept: application/json' \
-H 'content-type: application/json' \
-d '{
"content": [{"type":"text","text":"A white ceramic coffee mug on a glossy marble countertop with soft morning window light. The camera slowly orbits 360 degrees around the mug, steam gently rising."}],
"model": "doubao-seedance-2-0-fast-260128",
"resolution": "720p",
"ratio": "16:9",
"duration": 5
}'
¶ 內嵌參數說明
在 content[].text 提示詞末尾,可以透過附加 --parameter value 的形式傳入生成參數(舊方式,弱驗證,填寫錯誤時自動使用預設值)。完整參數列表如下:
| 內嵌參數 | 對應欄位 | 說明 | 取值範圍 |
|---|---|---|---|
--rs |
resolution |
輸出解析度 | 480p / 720p / 1080p |
--rt |
ratio |
寬高比 | 16:9 / 4:3 / 1:1 / 3:4 / 9:16 / 21:9 / adaptive |
--dur |
duration |
影片時長(秒) | 2–12 |
--frames |
frames |
影片影格數 | [29, 289] 中滿足 25+4n 的整數(僅 1.0 系列支援) |
--fps |
framespersecond |
影格率 | 僅支援 24 |
--seed |
seed |
隨機種子 | -1 到 4294967295 |
--cf |
camerafixed |
是否固定攝影機 | true / false |
--wm |
watermark |
是否新增浮水印 | true / false |
建議做法:直接在 Request Body 中使用對應的頂層欄位(如
resolution、ratio等),為強驗證模式,參數填寫錯誤時會回傳明確的錯誤提示,更易於排查問題。
¶ 生成有聲影片
Seedance 1.5 Pro 與 2.x 系列支援透過 generate_audio 參數生成帶音訊的影片:
{
"model": "doubao-seedance-1-5-pro-251215",
"content": [
{
"type": "text",
"text": "A girl holds a fox, the wind blows her hair, you can hear the sound of the wind"
}
],
"generate_audio": true,
"ratio": "16:9",
"duration": 5
}
1.0 系列不支援此參數。
¶ Seedance 2.5 全模態生成、編輯與延長
doubao-seedance-2-5-260628 支援 480p / 720p / 1080p、4–30 秒或自動時長,並將素材上限提高到 30 張參考圖片、10 段參考影片、10 段參考音訊(總計最多 50 個)。2.5 還支援僅傳入參考音訊,不再要求同時提供圖片或影片。
一般全模態生成可省略 omni_reference_task_type、設為 auto,或明確設為 reference。影片編輯與延長必須傳入 reference_video:
{
"model": "doubao-seedance-2-5-260628",
"content": [
{"type": "text", "text": "Replace the sky with a warm sunset while preserving the subject and camera motion."},
{"type": "video_url", "role": "reference_video", "video_url": {"url": "https://cdn.acedata.cloud/input.mp4"}}
],
"resolution": "720p",
"ratio": "adaptive",
"duration": -1,
"omni_reference_task_type": "edit",
"output_format": "mov"
}
reference:至少傳入一個reference_image、reference_video或reference_audio;2.5 支援僅傳入參考音訊。edit:必須使用ratio: adaptive和duration: -1;輸出時長按實際結果計費。extend:必須使用ratio: adaptive;duration可為 4–30 或-1。auto:模型根據提示詞和素材自動選擇生成、編輯或延長。- 任務類型與素材或提示詞不相符時,任務會失敗並回傳可定位問題的參數錯誤;請按上述限制調整後重新提交。
¶ 圖片生成影片首影格
如果想執行圖片生成影片任務,首先 content 參數需要包含 type 為 image_url 的項目,image_url 欄位必須為物件格式:{"url": "https://..."} 或 Base64 格式 {"url": "data:image/png;base64,..."}。
注意:
image_url不支援直接傳入字串格式(如"image_url": "https://cdn.acedata.cloud/e724d7f13d.png"),必須使用物件格式"image_url": {"url": "https://..."},否則會回傳 400 錯誤。
對應的程式碼:
import requests
url = "https://api.01ai.cloud/seedance/videos"
headers = {
"accept": "application/json",
"authorization": "Bearer {token}",
"content-type": "application/json"
}
payload = {
"content": [
{
"type": "image_url",
"image_url": {
"url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/i2v_foxrgirl.png"
}
},
{
"type": "text",
"text": "A girl holds a fox in her arms. She opens her eyes and gazes tenderly at the camera, while the fox affectionately holds her back. As the camera slowly pulls away, her hair is gently blown by the wind. --ratio adaptive --dur 5"
}
],
"model": "doubao-seedance-1-0-pro-250528"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
點擊執行,可以發現會立即得到一個結果,如下:
{
"success": true,
"task_id": "dc7cceb5-3c12-4de7-a5f4-abcbba3e8e39",
"trace_id": "b3b09de3-b7fa-4bb0-88b5-aad4b4a96fd4",
"data": {
"task_id": "cgt-20251222072003-x2259",
"status": "succeeded",
"video_url": "https://platform.cdn.acedata.cloud/seedance/6afb78b8-5ba8-424f-adcd-69423a700b50.mp4",
"model": "doubao-seedance-1-0-pro-250528"
}
}
可以看到,生成的效果是由圖片生成影片,結果與上文類似。
¶ 圖片生成影片首尾影格
如果想使用圖片生成影片首尾影格,首先參數 content 必須傳入類型 image_url,並且分別設定 role 為 first_frame 和 last_frame,就可以指定如下內容:
- role:指定首影格或者尾影格。
- image_url
- url 圖片連結
同時
content還需要輸入類型text作為 prompt 提示詞
- url 圖片連結
同時
對應的程式碼:
import requests
url = "https://api.01ai.cloud/seedance/videos"
headers = {
"accept": "application/json",
"authorization": "Bearer {token}",
"content-type": "application/json"
}
payload = {
"model": "doubao-seedance-1-0-pro-250528",
"content": [
{
"type": "text",
"text": "360-degree shot"
},
{
"type": "image_url",
"image_url": {
"url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_first_frame.jpeg"
},
"role": "first_frame"
},
{
"type": "image_url",
"image_url": {
"url": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_last_frame.jpeg"
},
"role": "last_frame"
}
]
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
點擊執行,可以發現會立即得到一個結果,如下:
{
"success": true,
"task_id": "f7096c6c-9430-4392-8201-d259632d7afd",
"trace_id": "4a4a3721-00fb-43d2-aff2-3b516ac01a8a",
"data": {
"task_id": "cgt-20251222073134-54qcw",
"status": "succeeded",
"video_url": "https://platform.cdn.acedata.cloud/seedance/95f9f5f0-fc50-4c71-bc6f-e154582c141e.mp4",
"model": "doubao-seedance-1-0-pro-250528"
}
}
可以看到,生成的效果是角色生成影片,結果與上文類似。
¶ 角色與音影片多模態參考(Seedance 2.0)
Seedance 2.0 系列(doubao-seedance-2-0-260128、doubao-seedance-2-0-fast-260128、doubao-seedance-2-0-mini-260615)支援 reference_image、reference_audio 與 reference_video。可使用自有或已獲授權的素材保持角色、主體、動作、運鏡、聲音與節奏的一致性。
請僅上傳自有或已獲授權的真人與角色素材。不同模型對真人素材的支援方式不同;請求格式保持不變,若素材不符合要求會回傳明確錯誤。
使用要點:
- 僅 Seedance 2.0 系列模型支援
reference_image;1.x 模型請使用first_frame/last_frame(圖片生成影片首尾影格)。 - 圖片生成影片首影格、圖片生成影片首尾影格和全模態參考是三種互斥場景:
first_frame/last_frame不能與reference_image/reference_video/reference_audio混用。 - 若想在全模態參考中指定首尾影格,請把圖片標為
reference_image,並在提示詞中寫明「圖片 1 作為首影格」或「圖片 2 作為尾影格」;若需要嚴格鎖定首尾影格,則只使用first_frame/last_frame。 - 多模態參考數量上限:
image_url最多 9 張;2.0 還支援audio_url(role為reference_audio,最多 3 條)與video_url(role為reference_video,最多 3 條)。 - 參考音訊(
audio_url)素材要求:格式wav/mp3;單條長度 2~15 秒,最多 3 條且總長度不超過 15 秒;單條不超過 15 MB。超出長度範圍會在素材處理階段失敗。 - 參考影片(
video_url)素材要求:格式mp4/mov;單條長度 2~15 秒,最多 3 條且總長度不超過 15 秒。 - 參考圖片建議使用單人、正臉、清晰、無遮擋的照片,人臉越清晰,相似度越高。
¶ 範例一:保持人物樣貌的特寫
傳入一張人臉照片,讓該人物對著鏡頭微笑揮手。對應的程式碼:
import requests
url = "https://api.01ai.cloud/seedance/videos"
headers = {
"accept": "application/json",
"authorization": "Bearer {token}",
"content-type": "application/json"
}
payload = {
"model": "doubao-seedance-2-0-fast-260128",
"content": [
{
"type": "text",
"text": "The woman looks at the camera, gives a warm natural smile and waves her hand, soft studio lighting, gentle camera push-in."
},
{
"type": "image_url",
"role": "reference_image",
"image_url": {
"url": "https://cdn.acedata.cloud/assets/examples/nanobanana/8e075897-0f50-4443-8500-666751791c6c-4346f66287c0.jpg"
}
}
],
"resolution": "480p",
"ratio": "9:16",
"duration": 5
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
回傳結果如下,生成的影片中人物與參考照片保持一致:
{
"success": true,
"task_id": "895eb5ea-bbe1-41a3-a9e9-48608e03f93a",
"trace_id": "83544791-7a84-44de-b8d2-afe171a1c0e4",
"data": {
"task_id": "458abf29-cc39-4fd0-bcea-24f89a70d8de",
"status": "succeeded",
"video_url": "https://cdn.acedata.cloud/assets/examples/seedance/e71d3cc5-27e7-4719-be34-1f0e254eccaf-a56b2736a4e0.mp4",
"model": "doubao-seedance-2-0-fast-260128",
"resolution": "480p",
"ratio": "9:16",
"duration": 5
}
}
¶ 範例二:把同一個人放進全新場景
reference_image 的強大之處在於:只保留人物身分,而場景、服裝、動作完全由提示詞決定。下面用同一張人臉照片,讓該人物身穿米色大衣走在秋日公園裡:
{
"model": "doubao-seedance-2-0-fast-260128",
"content": [
{
"type": "text",
"text": "The same woman wearing a beige coat walks through a sunny autumn park, golden leaves falling around her, she smiles softly at the camera, cinematic tracking shot."
},
{
"type": "image_url",
"role": "reference_image",
"image_url": {
"url": "https://cdn.acedata.cloud/assets/examples/nanobanana/8e075897-0f50-4443-8500-666751791c6c-4346f66287c0.jpg"
}
}
],
"resolution": "720p",
"ratio": "9:16",
"duration": 5
}
回傳結果如下,人物樣貌得以保留,而場景已切換為秋日公園:
{
"success": true,
"task_id": "00872de7-16b7-431f-b4f7-6bf38ae86157",
"trace_id": "577a07c3-4f5f-4cc7-86fe-535bb8332614",
"data": {
"task_id": "32fe1537-ba3e-452a-8749-3ef8890d37fd",
"status": "succeeded",
"video_url": "https://cdn.acedata.cloud/assets/examples/seedance/44f47593-556b-4fda-afa5-7a71eefcd228-2161efa5dd09.mp4",
"model": "doubao-seedance-2-0-fast-260128",
"resolution": "720p",
"ratio": "9:16",
"duration": 5
}
}
💡 若想讓人物精確複刻照片中的構圖(而非「換個場景的同一個人」),可改用
first_frame(圖生影片首影格),讓影片從這張照片開始運動。
¶ 非同步回呼
由於 SeeDance Videos Generation API 生成時間較長(約 1-2 分鐘),可透過 callback_url 欄位使用非同步模式,避免 HTTP 連線長時間佔用。
整體流程:用戶端發起請求時指定 callback_url,API 立即回傳包含 task_id 的回應;任務完成後,平台將生成結果以 POST JSON 的形式傳送到 callback_url,結果中同樣包含 task_id 以便關聯。
{
"task_id": "f7096c6c-9430-4392-8201-d259632d7afd"
}
任務完成時,平台推送到 callback_url 的內容如下:
{
"success": true,
"task_id": "f7096c6c-9430-4392-8201-d259632d7afd",
"trace_id": "4a4a3721-00fb-43d2-aff2-3b516ac01a8a",
"data": {
"task_id": "cgt-20251222073134-54qcw",
"status": "succeeded",
"video_url": "https://platform.cdn.acedata.cloud/seedance/95f9f5f0-fc50-4c71-bc6f-e154582c141e.mp4",
"model": "doubao-seedance-1-0-pro-250528"
}
}
結果中的 task_id 欄位與請求時回傳的一致,透過該欄位即可實現任務的關聯。
¶ 錯誤處理
在呼叫 API 時,如果遇到錯誤,API 會回傳相應的錯誤代碼和資訊。例如:
400 bad_request:請求使用了不支援的參數組合,例如為 Seedance 2.0 Fast/Mini 指定1080p或4k。請改用480p或720p。400 token_mismatched:錯誤的請求,可能是因為參數缺失或無效。400 api_not_implemented:錯誤的請求,可能是因為參數缺失或無效。401 invalid_token:未經授權,授權權杖無效或缺失。429 too_many_requests:請求過多,您已超出速率限制。500 api_error:伺服器內部錯誤,伺服器發生問題。
¶ 錯誤回應範例
{
"success": false,
"error": {
"code": "api_error",
"message": "fetch failed"
},
"trace_id": "2cf86e86-22a4-46e1-ac2f-032c0f2a4e89"
}
¶ 結論
透過本文件,您已經了解如何使用 Seedance Videos Generation API 進行文生影片、首尾影格與多模態參考生成,以及使用 Seedance 2.5 編輯或延長影片。希望本文件能幫助您完成 API 串接;如有問題,請聯絡技術支援。

