Skip to main content
POST
Python

Authorizations

Authorization
string
header
required

An account API key. Send it as Authorization: Bearer <key>.

Body

application/json

Start one video generation job.

model
string
required

The video model, named by its id or alias.

prompt
string
required

What to generate, in words. One to 8192 characters, and moderation screens it first.

models
string[] | null

Fallback models, tried in order when model cannot take the job: none of its providers accepted it, or the request does not fit it. At most 3, and only the model that took the job is billed. A NagaAI extension in OpenRouter's shape.

Maximum array length: 3
routing
object | null

How NagaAI picks the providers for this request: max_price removes the ones above it and can fail the request. A NagaAI extension.

duration
integer<int64> | null

Clip length in seconds; one of the duration values the model's video_generation operation lists in GET /v1/models. Absent takes its default.

resolution
string | null

One of the resolution values the operation lists, such as 720p. Absent takes its default.

aspect_ratio
string | null

One of the aspect_ratio values the operation lists, such as 16:9. Absent takes its default.

frame_images
object[] | null

Images that become the first or the last frame, one per frame type.

input_references
object[] | null

Images, videos or audio the clip should follow — a character, an object, a style, a motion, or the speech a talking avatar lip-syncs to — not frames it starts or ends on. Only a model whose operation lists input_references takes them: its properties give the most of each type, and its minimum what a request must carry.

generate_audio
boolean | null

Ask for a soundtrack. Only a model whose operation lists generate_audio accepts true, and the audio price applies.

seed
integer<int64> | null

A seed for repeatable output, where the model supports one.

upscale_factor
number<double> | null

How much an upscaling model enlarges the input clip, per side, within the minimum and maximum of the operation's upscale_factor. Absent takes its default. Only an upscaling model takes it.

creativity
integer<int64> | null

0 keeps the input clip as it is, 1 lets an upscaling model add detail; one of the values the operation's creativity lists, each its own price. Absent takes its default. Only an upscaling model takes it.

Response

The job, accepted and queued. Poll polling_url until status is completed or failed.

A video job as the gateway reports it.

id
string
required

The job id; the polling and content URLs carry it.

object
string
required

Always video.generation.

Example:

"video.generation"

model
string
required

The model the job was submitted for, as the caller named it.

status
string
required

pending, in_progress, completed or failed.

polling_url
string
required

Where to poll this job.

created_at
integer<int64>
required

Unix seconds when the job was accepted.

duration
integer<int64>
required

The requested clip length in seconds.

resolution
string
required

The requested resolution.

aspect_ratio
string
required

The requested aspect ratio.

completed_at
integer<int64> | null

Unix seconds when the job reached completed or failed.

urls
string[] | null

Links to the finished file; present once the job is completed.

usage
object | null

What the job was charged; present once the job is completed.

error
object | null

Why the job failed; present only when it is failed. A failed job is not charged.