跳轉到主要內容
POST
/
v1
/
videos
curl https://api.cometapi.com/v1/videos \
  -H "Authorization: Bearer <COMETAPI_KEY>" \
  -F 'prompt="A slow cinematic camera push across a coastal landscape at sunrise"' \
  -F 'model="doubao-seedance-2-0-fast"' \
  -F 'seconds="5"' \
  -F 'size="16:9"' \
  -F 'resolution="720p"'
{
  "id": "task_abc123",
  "task_id": "task_abc123",
  "object": "video",
  "model": "doubao-seedance-2-0-fast",
  "status": "SUBMITTED",
  "progress": 0,
  "created_at": 1776681149
}
使用此端點可啟動一個 ByteDance Seedance 影片任務。所有 Seedance 模型層級共用相同的請求格式;你可透過設定 model 欄位來選擇模型。此呼叫會立即回傳任務 id,而渲染會在背景持續進行。

選擇模型

Model idTierNotes
doubao-seedance-2-02.02.0 系列中輸出品質最高。
doubao-seedance-2-0-fast2.02.0 的較快變體,適合快速迭代與預覽。
doubao-seedance-1-5-pro1.5 Pro支援 1080p。僅支援文字轉影片。
doubao-seedance-1-0-pro1.0 Pro支援 1080p,且可產生最短 2 秒的較短片段。僅支援文字轉影片。
請參閱模型頁面以查看即時可用性。

參數範圍

FieldTypeRequiredDefaultAllowed values
promptstringyes任何文字
modelstringyesdoubao-seedance-2-0, doubao-seedance-2-0-fast, doubao-seedance-1-5-pro, doubao-seedance-1-0-pro
secondsintegerno5依模型而定(見下方)
sizestringno16:921:9, 16:9, 4:3, 1:1, 3:4, 9:16
resolutionstringno720p2.0 模型支援 480p720p;1.5 Pro 與 1.0 Pro 支援 480p720p1080p
input_referencefilenoJPEG、PNG 或 WebP。僅 2.0 模型可接受。

各模型的時長範圍

Modelseconds range
doubao-seedance-2-0, doubao-seedance-2-0-fast4 到 15
doubao-seedance-1-5-pro4 到 12
doubao-seedance-1-0-pro2 到 10
若傳送的值超出模型範圍,會回傳 HTTP 400,並帶有 code: "InvalidParameter" 以及關於 duration 的訊息。

圖轉影片支援

只有 2.0 模型可接受 input_reference 檔案。若對 doubao-seedance-1-5-prodoubao-seedance-1-0-pro 傳送 input_reference,會回傳 HTTP 400,訊息格式類似 the specified task_type r2v does not support model seedance-1-5-pro。這些模型僅可用於文字轉影片。

上傳參考圖片

請求主體為 multipart/form-data。若要在 2.0 模型上執行圖轉影片,請在同一個請求中將圖片附加為 input_reference 部分:
curl https://api.cometapi.com/v1/videos \
  -H "Authorization: Bearer <COMETAPI_KEY>" \
  -F 'prompt="A slow cinematic camera push across a coastal landscape at sunrise."' \
  -F 'model="doubao-seedance-2-0"' \
  -F 'seconds="5"' \
  -F 'size="16:9"' \
  -F 'resolution="720p"' \
  -F 'input_reference=@/path/to/reference.jpg'
請將 /path/to/reference.jpg 替換為你想用作首幀錨點圖片的絕對或相對路徑。支援的格式為 JPEG、PNG 與 WebP。

任務流程

1

Submit the task

傳送包含至少 promptmodel 的 POST 請求。請保存回傳的 id 以供下一步使用。
2

Poll the task

每 10 到 20 秒呼叫一次取得 Seedance 影片
3

Download the output

status 變為 SUCCESS 時,下載 video_url 中的檔案,若你需要長期存取,請重新託管。該 URL 已簽名,並會在有限時間後過期。

錯誤回應

當缺少必要欄位、值超出可接受範圍,或將 input_reference 傳送到不支援圖轉影片的模型時,此端點會回傳 HTTP 400。當 bearer token 缺失或無效時,則會回傳 HTTP 401。錯誤主體使用兩種格式之一;確切欄位請參閱 playground 中的 400 與 401 範例。

授權

Authorization
string
header
必填

Bearer token authentication. Use your CometAPI key.

主體

multipart/form-data
prompt
string
必填

Text prompt that describes the video. Required.

範例:

"A slow cinematic camera push across a coastal landscape at sunrise."

model
enum<string>
必填

Seedance model id. Choose doubao-seedance-2-0 for the highest quality 2.0 output, doubao-seedance-2-0-fast for quick iteration on 2.0, doubao-seedance-1-5-pro for the 1.5 Pro tier, or doubao-seedance-1-0-pro for the 1.0 Pro tier. Only the two 2.0 models accept input_reference.

可用選項:
doubao-seedance-2-0,
doubao-seedance-2-0-fast,
doubao-seedance-1-5-pro,
doubao-seedance-1-0-pro
範例:

"doubao-seedance-2-0-fast"

seconds
integer
預設值:5

Video duration in seconds. The accepted range depends on the model: doubao-seedance-2-0 and doubao-seedance-2-0-fast accept 4 to 15, doubao-seedance-1-5-pro accepts 4 to 12, and doubao-seedance-1-0-pro accepts 2 to 10. The default is 5 for every model.

必填範圍: 2 <= x <= 15
範例:

5

size
enum<string>
預設值:16:9

Output aspect ratio. All Seedance models accept the same set of values.

可用選項:
21:9,
16:9,
4:3,
1:1,
3:4,
9:16
範例:

"16:9"

resolution
enum<string>
預設值:720p

Output resolution. 480p and 720p are accepted by every model; 1080p is supported only by doubao-seedance-1-5-pro and doubao-seedance-1-0-pro.

可用選項:
480p,
720p,
1080p
範例:

"720p"

input_reference
file

Optional reference image. When included, the job runs in image-to-video mode and uses the image as the visual anchor. Only doubao-seedance-2-0 and doubao-seedance-2-0-fast accept this field; sending it with a 1.0 Pro or 1.5 Pro model returns HTTP 400.

回應

Task created. Save the returned id and poll GET /v1/videos/{id}.

id
string
必填

Task id. Use it as the path parameter for GET /v1/videos/{id}.

object
string
必填

Object type, always video.

model
string
必填

Echo of the requested model id.

status
enum<string>
必填

Initial task status. A newly created task is returned as SUBMITTED.

可用選項:
SUBMITTED,
IN_PROGRESS,
SUCCESS,
FAILED,
ERROR
progress
integer
必填

Completion percentage. 0 at creation.

必填範圍: 0 <= x <= 100
created_at
integer
必填

Task creation time as a Unix timestamp in seconds.

task_id
string

Alias of id returned for compatibility. The value matches id.