Skip to main content
Use POST /v2/videos/generations to start a video generation. Video generation is asynchronous, so you submit once, poll for status, and download the finished asset when it’s ready.

The generation flow

1

Submit a generation request

POST to /v2/videos/generations with your model, prompt, and parameters. The API returns HTTP 202 with a generation ID and status: "pending".
2

Poll for completion

GET /v2/videos/generations/{id} periodically. The status will be pending, failed, or completed.
3

Download the video

When status is completed, download the video from the signed download URL in data[0].url.

Step 1: Submit

Step 2: Poll for status

Poll the status endpoint with your generation ID.
Completed response:

Polling strategy

Poll every 5 seconds as a starting point. Set a timeout so your integration stays responsive and does not poll forever.

Step 3: Download

The url in each data item is a signed download URL. Generated media is retained for 24 hours, and the URL expires at the deletes_at timestamp.

Parameters

Using frame and reference images

Pass up to 20 images in the images array. Each item needs a url and a role. Video models support these roles:
  • first_frame: the opening frame of the video
  • last_frame: the closing frame of the video. This always requires a first_frame.
  • reference_image: a style or content reference when you need the output to stay closer to an existing visual direction. You cannot combine it with first_frame or last_frame.
Not all models support all roles. A model’s supported_references field lists the roles it accepts and the maximum count for each. See Models. Unsupported roles return 400 with code invalid_parameter.

Image sources

url accepts either form:
  • a publicly accessible HTTPS URL
  • a base64 data URL, such as data:image/png;base64,...
Use a data URL when the frame only exists on your side and you don’t want to host it first.
Inline images must be PNG, JPEG, or WebP. Bare base64 without the data: prefix is rejected.
A decoded image can be up to 10 MiB, and the whole JSON request must fit within 25 MiB. Base64 adds roughly 33% to the original file size, so budget for that before you inline both a first and last frame. Pass an HTTPS URL instead when you’re close to the limit.

Failure states

Video generations can fail after submission.
  • If polling returns status: "failed", treat that generation as terminal.
  • Read error.message for the reason.
  • Fix the input, wait if the problem is temporary, or submit a new generation.

Sound

Set sound: true to generate audio. Supported models are listed on the Models page.

Full example