Skip to main content
POST
cURL
Gunakan endpoint ini untuk membuat task text-to-video Wan. API akan langsung mengembalikan task ID, jadi simpan id yang dikembalikan dan lakukan polling pada task sampai mencapai status terminal. POST /v1/videos menggunakan multipart/form-data; kirim kontrol skalar sebagai form field.

Pilih model

Atur durasi dan ukuran

Atur size ke salah satu nilai WxH di bawah ini untuk model target.

Nilai size Wan 2.7

Nilai size Wan 2.6

Alur task

1

Buat task

Kirim permintaan form multipart dan simpan id yang dikembalikan.
2

Polling task

Panggil Mengambil video Wan sampai status bernilai completed, failed, atau error.
3

Unduh hasil

Saat task berstatus completed, panggil Mengambil konten video Wan untuk mengunduh file MP4.

Otorisasi

Authorization
string
header
wajib

Bearer authentication. Use your CometAPI API key.

Body

multipart/form-data
model
enum<string>
wajib

Wan model ID for this endpoint.

Opsi yang tersedia:
wan2.6,
wan2.7
Contoh:

"wan2.6"

prompt
string
wajib

Text prompt that describes the video to generate.

Contoh:

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

Contoh:

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

Contoh:

"1280x720"

Respons

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

id
string
wajib

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

Contoh:

"task_example"

object
string
wajib

Object type. Video tasks return video.

Contoh:

"video"

model
string
wajib

Model ID used for the task.

Contoh:

"wan2.6"

status
enum<string>
wajib

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

Opsi yang tersedia:
queued,
in_progress,
completed,
failed,
error
Contoh:

"queued"

progress
integer
wajib

Task progress as a coarse percentage.

Rentang yang diperlukan: 0 <= x <= 100
Contoh:

0

created_at
integer
wajib

Task creation time as a Unix timestamp in seconds.

Contoh:

1779938152

task_id
string

Compatibility alias for id when present.

Contoh:

"task_example"

completed_at
integer

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

Contoh:

1779938219

video_url
string

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

Contoh:

"<temporary-video-url>"

error
object

Failure details. This field appears when the task fails.