Skip to main content
POST
cURL
Sử dụng endpoint này để tạo một tác vụ text-to-video Wan. API trả về một task ID ngay lập tức, vì vậy hãy lưu id được trả về và poll tác vụ cho đến khi nó đạt trạng thái kết thúc. POST /v1/videos sử dụng multipart/form-data; truyền các tham số điều khiển dạng scalar dưới dạng các trường của form.

Chọn model

Thiết lập thời lượng và kích thước

Đặt size thành một trong các giá trị WxH bên dưới cho model đích.

Giá trị kích thước của Wan 2.7

Giá trị kích thước của Wan 2.6

Luồng tác vụ

1

Tạo tác vụ

Gửi request form multipart và lưu id được trả về.
2

Poll tác vụ

Gọi Truy xuất video Wan cho đến khi statuscompleted, failed, hoặc error.
3

Tải xuống kết quả

Khi tác vụ ở trạng thái completed, hãy gọi Truy xuất nội dung video Wan để tải xuống tệp MP4.

Ủy quyền

Authorization
string
header
bắt buộc

Bearer authentication. Use your CometAPI API key.

Nội dung

multipart/form-data
model
enum<string>
bắt buộc

Wan model ID for this endpoint.

Tùy chọn có sẵn:
wan2.6,
wan2.7
Ví dụ:

"wan2.6"

prompt
string
bắt buộc

Text prompt that describes the video to generate.

Ví dụ:

"A small robot walks through a bright greenhouse with smooth camera movement."

seconds
string

Requested clip duration in seconds. For wan2.6, use 5, 10, or 15. For wan2.7, use an integer from 2 through 15. Default is 5.

Ví dụ:

"5"

size
string

Supported WxH size values. For wan2.6: 1280x720, 720x1280, 1088x832, 832x1088, 1920x1080, 1080x1920, 1440x1440, 1632x1248, 1248x1632. For wan2.7: 1280x720, 720x1280, 1920x1080, 1080x1920, 1440x1440. Default is 1920x1080.

Ví dụ:

"1280x720"

Phản hồi

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

id
string
bắt buộc

Task ID. Use this value with retrieve and content endpoints.

Ví dụ:

"task_example"

object
string
bắt buộc

Object type. Video tasks return video.

Ví dụ:

"video"

model
string
bắt buộc

Model ID used for the task.

Ví dụ:

"wan2.6"

status
enum<string>
bắt buộc

Task lifecycle status. Poll until the value is completed, failed, or error.

Tùy chọn có sẵn:
queued,
in_progress,
completed,
failed,
error
Ví dụ:

"queued"

progress
integer
bắt buộc

Task progress as a coarse percentage.

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

0

created_at
integer
bắt buộc

Task creation time as a Unix timestamp in seconds.

Ví dụ:

1779938152

task_id
string

Compatibility alias for id when present.

Ví dụ:

"task_example"

completed_at
integer

Task completion time as a Unix timestamp in seconds. This field appears on completed tasks.

Ví dụ:

1779938219

video_url
string

Temporary video delivery URL. This field appears on completed tasks.

Ví dụ:

"<temporary-video-url>"

error
object

Failure details. This field appears when the task fails.