Create Video

Submit a video generation job. Answers 202 with a pending job to poll.

Submit a video generation job. The API answers 202 Accepted with a video job whose status is pending; poll its polling_url until it finishes.

POST /v1/videos

Headers

AuthorizationBearerrequired

API key. See Authentication.

Content-Typestringrequired

Must be application/json.

Body

modelstringrequired

The video model to use (e.g. veo-3.1). List them with GET /v1/videos/models.

promptstringoptional

A text description of the video to generate. Required unless frame_images has an entry.

durationintegeroptional

Length of the video in whole seconds. You are billed for exactly the duration rendered. When omitted, the model's default applies.

resolutionstringoptional

Output resolution, e.g. 720p. Case-insensitive. When omitted, the model's default applies.

aspect_ratiostringoptional

Output aspect ratio, e.g. 16:9 for landscape or 9:16 for portrait. When omitted, the model's default applies.

sizestringoptional

Exact output size as WIDTHxHEIGHT (e.g. 1280x720), an alternative to resolution + aspect_ratio. A size the model doesn't render is rejected with 400, and the message lists the sizes it does render. If you also send resolution or aspect_ratio and they describe a different size, the request is rejected with 400.

frame_imagesobject[]optional

Images that pin the first and/or last frame of the video. Each item is { "type": "image_url", "image_url": { "url": "..." }, "frame_type": "first_frame" }.

  • frame_type is first_frame or last_frame; at most one of each. Which frame types a model takes is per model: a frame type the model does not take, or any frame_images on a model that takes none, is rejected with 400. The model must also accept image input.
  • url is a fully qualified URL, a base64 data URL (data:image/png;base64,...), or the id of an image uploaded with POST /v1/files (file-...).
input_referencesobject[]optional

Reference images that guide the look of the video without pinning a frame: { "type": "image_url", "image_url": { "url": "..." } }, with the same url forms as frame_images. Items of type audio_url or video_url are accepted and ignored. The whole array is ignored when frame_images has an entry. The model must accept image input, and some models cap the number of reference images (or take none); more than the model allows is rejected with 400.

Allowed values are per model

Which durations, resolutions and aspect ratios a model accepts depends on the model. GET /v1/videos/models lists them per model in supported_durations, supported_resolutions and supported_aspect_ratios. supported_sizes is always empty; a size the model doesn't render is rejected with 400 naming the sizes it does.

  • A value outside the model's list is rejected with 400.
  • A model whose list is empty does not accept that option at all: sending it is rejected with 400.
  • When you omit an option, the model's own default applies. Aivene fills nothing in for you.

Frame types (frame_images[].frame_type) and the number of image input_references are per model too, checked the same way: a frame type the model does not take, or more reference images than it allows, is rejected with 400.

For example, Veo 3.1 takes duration 4, 6 or 8, resolution 720p or 1080p, and aspect_ratio 16:9 or 9:16. Its input images can be png, jpeg, webp or gif, up to 20 MB each. Check GET /v1/videos/models for the current values rather than relying on this example.

Response

idstringoptional

Unique job identifier.

polling_urlstringoptional

Relative URL to poll: /v1/videos/{id}.

status'pending'optional

A new job is always pending.

The full set of fields is described in the video job object.

Errors

StatusReason
400Missing model, missing both prompt and frame_images, or a value the model does not support.
401Missing or invalid API key.
402Not enough credit for the job, an unpaid balance, or a spend limit was reached.
403The model isn't included in your organization's tier, or the API key isn't scoped to a workspace.
429Your organization hit its rate limit for this model.

See Errors for the error.type of each status.