Skip to navigation

Start a video

Starts a video job and returns it with status queued. Poll GET /v1/videos/{id} until it is completed, then download it from its url or from GET /v1/videos/{id}/content. The job is held for seconds at the price per second for its resolution, and charged once the video is made. A video that fails isn’t charged.

Authentication

AuthorizationBearer

Your API key, sk-..., from Console → API keys.

Request

This endpoint expects an object.
modelstringRequired
promptstringRequired
secondsstringRequired
Length of the video in seconds, a positive whole number. Each model has a maximum.
sizestringOptional

Aspect ratio, such as 16:9 or 9:16. Each model offers its own.

resolutionstringOptional

Such as 720p or 1080p, on models priced by resolution. Without it, the model’s base price per second applies.

input_referencestringOptionalformat: "binary"
An image to start the video from, on models that take one.
last_framestringOptional
An image to end the video on
reference_imageslist of stringsOptional
Images that guide the video's look, on models that take them.
seedintegerOptional
generate_audiobooleanOptional
On models that can make sound.
watermarkbooleanOptional
return_last_framebooleanOptional
userstringOptional
metadatamap from strings to stringsOptional

Response

The new job.
idstringOptional
objectenumOptional
Allowed values:
modelstringOptional
statusenumOptional
Allowed values:
progressintegerOptional0-100
secondsstringOptional
sizestringOptional
created_atintegerOptional
Unix seconds.
completed_atinteger or nullOptional
expires_atinteger or nullOptional

Unix seconds when url stops working, or, without a url, when the video expires.

urlstringOptional

A direct link to the finished video, until expires_at.

errorobject or nullOptional

Errors

400
Bad Request Error
401
Unauthorized Error
402
Payment Required Error
403
Forbidden Error
404
Not Found Error
429
Too Many Requests Error
502
Bad Gateway Error
503
Service Unavailable Error