Skip to main content
POST
cURL
Використовуйте цей endpoint, щоб створити завдання Wan для text-to-video. API одразу повертає ID завдання, тож збережіть повернене id і опитуйте завдання, доки воно не досягне кінцевого статусу. POST /v1/videos використовує multipart/form-data; передавайте скалярні параметри керування як поля форми.

Виберіть модель

Налаштуйте тривалість і розмір

Встановіть size в одне зі значень WxH нижче для цільової моделі.

Значення size для Wan 2.7

Значення size для Wan 2.6

Потік завдання

1

Створіть завдання

Надішліть multipart form-запит і збережіть повернене id.
2

Опитуйте завдання

Викликайте Retrieve a Wan video, доки status не стане completed, failed або error.
3

Завантажте результат

Коли завдання має статус completed, викличте Retrieve Wan video content, щоб завантажити файл MP4.

Авторизації

Authorization
string
header
обов'язково

Bearer authentication. Use your CometAPI API key.

Тіло

multipart/form-data
model
enum<string>
обов'язково

Wan model ID for this endpoint.

Доступні опції:
wan2.6,
wan2.7
Приклад:

"wan2.6"

prompt
string
обов'язково

Text prompt that describes the video to generate.

Приклад:

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

Приклад:

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

Приклад:

"1280x720"

Відповідь

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

id
string
обов'язково

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

Приклад:

"task_example"

object
string
обов'язково

Object type. Video tasks return video.

Приклад:

"video"

model
string
обов'язково

Model ID used for the task.

Приклад:

"wan2.6"

status
enum<string>
обов'язково

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

Доступні опції:
queued,
in_progress,
completed,
failed,
error
Приклад:

"queued"

progress
integer
обов'язково

Task progress as a coarse percentage.

Необхідний діапазон: 0 <= x <= 100
Приклад:

0

created_at
integer
обов'язково

Task creation time as a Unix timestamp in seconds.

Приклад:

1779938152

task_id
string

Compatibility alias for id when present.

Приклад:

"task_example"

completed_at
integer

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

Приклад:

1779938219

video_url
string

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

Приклад:

"<temporary-video-url>"

error
object

Failure details. This field appears when the task fails.