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/videosHeaders
AuthorizationBearerrequiredAPI key. See Authentication.
Content-TypestringrequiredMust be application/json.
Body
modelstringrequiredThe video model to use (e.g. veo-3.1). List them with
GET /v1/videos/models.
promptstringoptionalA text description of the video to generate. Required unless
frame_images has an entry.
durationintegeroptionalLength of the video in whole seconds. You are billed for exactly the duration rendered. When omitted, the model's default applies.
resolutionstringoptionalOutput resolution, e.g. 720p. Case-insensitive. When omitted, the
model's default applies.
aspect_ratiostringoptionalOutput aspect ratio, e.g. 16:9 for landscape or 9:16 for portrait.
When omitted, the model's default applies.
sizestringoptionalExact 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[]optionalImages 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_typeisfirst_frameorlast_frame; at most one of each. Which frame types a model takes is per model: a frame type the model does not take, or anyframe_imageson a model that takes none, is rejected with400. The model must also accept image input.urlis a fully qualified URL, a base64 data URL (data:image/png;base64,...), or the id of an image uploaded withPOST /v1/files(file-...).
input_referencesobject[]optionalReference 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
idstringoptionalUnique job identifier.
polling_urlstringoptionalRelative URL to poll: /v1/videos/{id}.
status'pending'optionalA new job is always pending.
The full set of fields is described in the video job object.
Errors
| Status | Reason |
|---|---|
400 | Missing model, missing both prompt and frame_images, or a value the model does not support. |
401 | Missing or invalid API key. |
402 | Not enough credit for the job, an unpaid balance, or a spend limit was reached. |
403 | The model isn't included in your organization's tier, or the API key isn't scoped to a workspace. |
429 | Your organization hit its rate limit for this model. |
See Errors for the error.type of each status.