Skip to main content
POST
/
v1
/
videos
cURL
curl https://api.cometapi.com/v1/videos \
  -H "Authorization: Bearer $COMETAPI_KEY" \
  -F model=happyhorse-1.0 \
  -F 'prompt=A person reads beside a tall window while soft daylight moves across the room.' \
  -F seconds=3 \
  -F size=1280x720
{
  "id": "task_example",
  "task_id": "task_example",
  "object": "video",
  "model": "happyhorse-1.0",
  "status": "queued",
  "progress": 0,
  "created_at": 1779938152
}
Use this endpoint to create a HappyHorse 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 an input mode

GoalRequired fieldsOptional fields
Text-to-videomodel, promptseconds, size
Use model=happyhorse-1.0 for this page.

Set duration and size

Model IDsecondsDefault
happyhorse-1.0integer 3-155 seconds, 1920x1080
Set size to one of the WxH values below.
Resolution tierAspect ratiosize (WxH)
720p16:91280x720
9:16720x1280
1080p16:91920x1080
9:161080x1920
1:11440x1440

Task flow

1

Create the task

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

Poll the task

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

Download the result

When the task is completed, call Retrieve HappyHorse 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

HappyHorse model ID for this endpoint.

Available options:
happyhorse-1.0
Example:

"happyhorse-1.0"

prompt
string
required

Text prompt that describes the video to generate.

Example:

"A person reads beside a tall window while soft daylight moves across the room."

seconds
string

Requested clip duration in seconds. Use an integer from 3 through 15. Default is 5.

Example:

"3"

size
string

Supported WxH size values: 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:

"happyhorse-1.0"

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.