Skip to main content
POST
/
v1
/
videos
cURL
curl https://api.cometapi.com/v1/videos \
  -H "Authorization: Bearer $COMETAPI_KEY" \
  -F model=wan2.6 \
  -F 'prompt=A small robot walks through a bright greenhouse with smooth camera movement.' \
  -F seconds=5 \
  -F size=1280x720
{
  "id": "task_example",
  "task_id": "task_example",
  "object": "video",
  "model": "wan2.6",
  "status": "queued",
  "progress": 0,
  "created_at": 1779938152
}
Use this endpoint to create a Wan text-to-video task. The API returns a task ID immediately, so store the returned id and poll the task until it reaches a terminal status. POST /v1/videos uses multipart/form-data; pass scalar controls as form fields.

Choose a model

Model IDInput mode
wan2.7Text-to-video
wan2.6Text-to-video

Set duration and size

Model IDsecondsDefault
wan2.7integer 2-155 seconds, 1920x1080
wan2.65, 10, 155 seconds, 1920x1080
Set size to one of the WxH values below for the target model.

Wan 2.7 size values

Resolution tierAspect ratiosize (WxH)
720p16:91280x720
9:16720x1280
1080p16:91920x1080
9:161080x1920
1:11440x1440

Wan 2.6 size values

Resolution tierAspect ratiosize (WxH)
720p16:91280x720
9:16720x1280
4:31088x832
3:4832x1088
1080p16:91920x1080
9:161080x1920
1:11440x1440
4:31632x1248
3:41248x1632

Task flow

1

Create the task

Send the multipart form request and store the returned id.
2

Poll the task

Call Retrieve a Wan video until status is completed, failed, or error.
3

Download the result

When the task is completed, call Retrieve Wan video content to download the MP4 file.

Authorizations

Authorization
string
header
required

Bearer authentication. Use your CometAPI API key.

Body

multipart/form-data
model
enum<string>
required

Wan model ID for this endpoint.

Available options:
wan2.6,
wan2.7
Example:

"wan2.6"

prompt
string
required

Text prompt that describes the video to generate.

Example:

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

Example:

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

Example:

"1280x720"

Response

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

id
string
required

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

Example:

"task_example"

object
string
required

Object type. Video tasks return video.

Example:

"video"

model
string
required

Model ID used for the task.

Example:

"wan2.6"

status
enum<string>
required

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

Available options:
queued,
in_progress,
completed,
failed,
error
Example:

"queued"

progress
integer
required

Task progress as a coarse percentage.

Required range: 0 <= x <= 100
Example:

0

created_at
integer
required

Task creation time as a Unix timestamp in seconds.

Example:

1779938152

task_id
string

Compatibility alias for id when present.

Example:

"task_example"

completed_at
integer

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

Example:

1779938219

video_url
string

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

Example:

"<temporary-video-url>"

error
object

Failure details. This field appears when the task fails.