Skip to main content
POST
Create a video

Authorizations

Authorization
string
header
required

A workspace API key in an Authorization: Bearer header. A missing header, a scheme other than Bearer, a key of the wrong shape, and a key we reject are all 401.

Body

Create a video job. The body may be JSON or multipart/form-data; an input_reference image rides in the form.

model
string
required

The model to call. A provider-pinned id, {provider}/{model}, is split once on the first slash. A routing-profile slug, profile/{identifier}, tries that profile's models in your own order. unirouter/auto, or its second spelling hopscotch/auto, names whichever route your workspace made its default. A bare model id is refused with 400 and the code model_id_not_pinned. GET /v1/models lists the exact strings this key can call.

Example:

"openai/sora-2"

size
string
required

The resolution, such as "1280x720". Required: a create that names none is refused before anything is held. It must have a per-second rate on the model; one without is refused before anything is held. A create naming a size the model does not publish is refused 400 before anything is held.

Example:

"1280x720"

prompt
string

Required for text-to-video. A model that renders from an image permits an omitted prompt when input_reference is uploaded.

Example:

"A paper boat drifting down a rainy street."

seconds
string

Whole seconds of video, 1 or more, as decimal digits without whitespace, hexadecimal or exponent notation (such as "8"); JSON also accepts a positive safe integer. Absent, 4. A hold beyond the safe money range is refused with 400 naming seconds and the cap at the matching published rate, before any credit is held. A create naming a duration the model does not publish is refused 400 before anything is held.

Example:

"8"

input_reference
file

A reference image, sent as a multipart file part under this name. A model that renders from an image only requires it, and with an accepted image reference prompt is optional. A model that renders from text only refuses it. Each model accepts only the image forms and sizes it publishes.

Response

The provider's video job object (id, status, progress), with external URLs omitted. A recorded job is charged when a terminal status is observed. If the provider returns no readable job id or an id already recorded for that provider, the full hold is charged immediately and usage is recorded under this create request's unique request id.

One video job, as the provider reports it, with external URLs omitted and model rewritten to the public id the create returned. Providers report different extra fields; only the fields below are promised.

id
string
required

The job id the create answered. Pass it to the follow-up paths.

Example:

"video_123"

object
enum<string>
required
Available options:
video
model
string
required

The public provider/model id the create returned, so a poll names the model exactly as the create did.

Example:

"openai/sora-2"

status
enum<string>
required

Where the job stands. A provider that answers succeeded means completed.

Available options:
queued,
in_progress,
completed,
failed,
cancelled,
succeeded
progress
integer

How far along the provider says the job is, 0 to 100.

created_at
integer | null

When the job was created, in Unix seconds.

size
string

The requested size, in OpenAI WIDTHxHEIGHT spelling.

Example:

"1280x720"

seconds
string

The seconds of video, as a decimal string. A completed job reports what it rendered; settlement never charges above what the hold covered.

Example:

"8"

error
object

Present when the job failed: the provider's reason, with a stable code and a prose message.