Chuyển đến nội dung chính
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
}
Sử dụng endpoint này để khởi tạo một job video ByteDance Seedance. Tất cả các tier model Seedance dùng chung cùng một cấu trúc request; bạn chọn model bằng cách đặt trường model. Lệnh gọi trả về task id ngay lập tức và quá trình render tiếp tục ở chế độ nền.

Chọn một model

Model idTierGhi chú
doubao-seedance-2-02.0Chất lượng đầu ra cao nhất trong họ 2.0.
doubao-seedance-2-0-fast2.0Biến thể nhanh hơn của 2.0 để lặp nhanh và xem trước.
doubao-seedance-1-5-pro1.5 ProHỗ trợ 1080p. Chỉ text-to-video.
doubao-seedance-1-0-pro1.0 ProHỗ trợ 1080p và các clip ngắn hơn từ 2 giây. Chỉ text-to-video.
Xem trang Models để biết trạng thái khả dụng theo thời gian thực.

Phạm vi tham số

FieldTypeRequiredDefaultAllowed values
promptstringyesbất kỳ văn bản nào
modelstringyesdoubao-seedance-2-0, doubao-seedance-2-0-fast, doubao-seedance-1-5-pro, doubao-seedance-1-0-pro
secondsintegerno5phụ thuộc vào model (xem bên dưới)
sizestringno16:921:9, 16:9, 4:3, 1:1, 3:4, 9:16
resolutionstringno720p480p, 720p cho các model 2.0; 480p, 720p, 1080p cho 1.5 Pro và 1.0 Pro
input_referencefilenoJPEG, PNG hoặc WebP. Chỉ được chấp nhận bởi các model 2.0.

Phạm vi thời lượng theo model

ModelPhạm vi seconds
doubao-seedance-2-0, doubao-seedance-2-0-fast4 đến 15
doubao-seedance-1-5-pro4 đến 12
doubao-seedance-1-0-pro2 đến 10
Gửi một giá trị ngoài phạm vi của model sẽ trả về HTTP 400 với code: "InvalidParameter" và một thông báo về duration.

Hỗ trợ image-to-video

Chỉ các model 2.0 chấp nhận tệp input_reference. Gửi input_reference với doubao-seedance-1-5-pro hoặc doubao-seedance-1-0-pro sẽ trả về HTTP 400 với thông báo có dạng the specified task_type r2v does not support model seedance-1-5-pro. Chỉ dùng các model đó cho text-to-video.

Tải lên một ảnh tham chiếu

Phần thân request là multipart/form-data. Để chạy image-to-video trên model 2.0, đính kèm ảnh dưới dạng phần input_reference trong cùng request:
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'
Thay /path/to/reference.jpg bằng đường dẫn tuyệt đối hoặc tương đối tới ảnh bạn muốn dùng làm neo khung hình đầu tiên. Các định dạng được hỗ trợ là JPEG, PNG và WebP.

Luồng task

1

Submit the task

Gửi một request POST với ít nhất promptmodel. Lưu id được trả về cho bước tiếp theo.
2

Poll the task

Gọi Truy xuất một video Seedance mỗi 10 đến 20 giây.
3

Download the output

Khi status trở thành SUCCESS, tải tệp tại video_url xuống và lưu trữ lại trên máy chủ của bạn nếu cần truy cập dài hạn. URL được ký và sẽ hết hạn sau một khoảng thời gian giới hạn.

Phản hồi lỗi

Endpoint trả về HTTP 400 khi thiếu trường bắt buộc, một giá trị nằm ngoài phạm vi được chấp nhận hoặc input_reference được gửi tới một model không hỗ trợ image-to-video. Endpoint trả về HTTP 401 khi bearer token bị thiếu hoặc không hợp lệ. Phần thân lỗi sử dụng một trong hai cấu trúc; xem các ví dụ 400 và 401 trong playground để biết chính xác các trường.

Ủy quyền

Authorization
string
header
bắt buộc

Bearer token authentication. Use your CometAPI key.

Nội dung

multipart/form-data
prompt
string
bắt buộc

Text prompt that describes the video. Required.

Ví dụ:

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

model
enum<string>
bắt buộc

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.

Tùy chọn có sẵn:
doubao-seedance-2-0,
doubao-seedance-2-0-fast,
doubao-seedance-1-5-pro,
doubao-seedance-1-0-pro
Ví dụ:

"doubao-seedance-2-0-fast"

seconds
integer
mặc định: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.

Phạm vi bắt buộc: 2 <= x <= 15
Ví dụ:

5

size
enum<string>
mặc định:16:9

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

Tùy chọn có sẵn:
21:9,
16:9,
4:3,
1:1,
3:4,
9:16
Ví dụ:

"16:9"

resolution
enum<string>
mặc định: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.

Tùy chọn có sẵn:
480p,
720p,
1080p
Ví dụ:

"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.

Phản hồi

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

id
string
bắt buộc

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

object
string
bắt buộc

Object type, always video.

model
string
bắt buộc

Echo of the requested model id.

status
enum<string>
bắt buộc

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

Tùy chọn có sẵn:
SUBMITTED,
IN_PROGRESS,
SUCCESS,
FAILED,
ERROR
progress
integer
bắt buộc

Completion percentage. 0 at creation.

Phạm vi bắt buộc: 0 <= x <= 100
created_at
integer
bắt buộc

Task creation time as a Unix timestamp in seconds.

task_id
string

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