Video generation is asynchronous. Submit a job with
POST /v1/videos/generations, poll GET /v1/videos/generations/{job_id}
until it finishes, then download the returned HTTPS CDN URL. The gateway does
not return direct upstream storage URLs to clients.
The API token must have the async video scope. New active tokens classified
as external customers receive both video and audio by default; either can
be revoked in the admin UI. Async text and image remain opt-in, and existing
explicit token policies are never overwritten by the managed customer
default.
Available Models
| Model | Durations | Resolutions | Aspect ratios | Clips per request | Workflows |
|---|---|---|---|---|---|
veo-3.1-generate-001 (Veo 3.1) |
4, 6, 8 sec (default 8) | 720p, 1080p |
16:9, 9:16 |
1-4 | text, start frame, first+last frame, extend |
veo-3.1-fast-generate-001 (Veo 3.1 Fast) |
4, 6, 8 sec (default 8) | 720p, 1080p |
16:9, 9:16 |
1-4 | text, start frame, first+last frame, reference images, extend |
veo-3.1-lite-generate-001 (Veo 3.1 Lite) |
4, 6, 8 sec (default 8) | 720p, 1080p |
16:9, 9:16 |
1-4 | text, start frame, first+last frame, reference images, extend |
gemini-omni-1.1-flash (Gemini Omni 1.1 Flash) |
4, 6, 8, 10 sec (default 8) | 360p, 720p |
16:9, 9:16 |
1 | text, start frame, first+last frame, reference images, edit |
Other video IDs available to some accounts:
| Model | Mode | Price | Durations | Samples | Resolutions |
|---|---|---|---|---|---|
veo-3-fast |
Fast | $0.50 base (5s) | 5 sec | 1 | 9:16, 16:9, auto |
veo-3-quality |
Quality | $1.50 base (5s) | 5 sec | 1 | 9:16, 16:9, auto |
pika-2.2 |
Image-animation | $0.50 per video | up to 6s | 1 | image-driven |
kling-1.6 / kling-2.0 / kling-2.5 / kling-3.0 |
Image+prompt → video | $0.375 base (5s); scales linearly for 10s/15s | 5, 10, 15 sec (15s on kling-3.0 only) |
1 | 1:1, 9:16, 16:9 |
deepface-video |
Face swap in video | $0.05 base | input video length | 1 | inherits input |
upscale-video-hd / -fhd / -4k |
Video upscaler | $0.30 / $0.60 / $2.40 base (30s clip) | input video length | 1 | output: 720p / 1080p / 2160p |
Video pricing
Veo and Gemini Omni are billed per generated second at Google's official
rates. Your account discount applies to these amounts; every finished job
reports billing.official_amount_usd, billing.discount_percent and
billing.charged_amount_usd.
Official price per second (with audio / without audio):
| Model | 720p |
1080p |
|---|---|---|
veo-3.1-generate-001 |
$0.40 / $0.20 | $0.40 / $0.20 |
veo-3.1-fast-generate-001 |
$0.10 / $0.08 | $0.12 / $0.10 |
veo-3.1-lite-generate-001 |
$0.05 / $0.03 | $0.08 / $0.05 |
- A Veo charge is
price_per_second × duration × clips. An 8-second Veo 3.1 Fast clip at720pwith audio is $0.80 before your discount. - An extension generates 7 more seconds and is billed as 7 seconds at the same rate (resolution and audio of the extension).
- Gemini Omni 1.1 Flash is billed by tokens like Google: $1.50 per 1M
input tokens and $17.50 per 1M video output tokens. Google counts 5,792
video tokens per second at
720p(about $0.10 per second) and 1,931 at360p(about $0.034 per second, one third). Omni clips always carry audio. - When a job is accepted, the gateway reserves the estimated amount (for Omni, a conservative maximum) and settles to the real amount when the clip is delivered. A job that fails before a clip is delivered releases the reservation, so you are not charged.
Veo 3.1
Supported mode values (task is accepted as a synonym):
mode |
Required input | Notes |
|---|---|---|
text_to_video |
prompt |
Used when no media input is provided. |
image_to_video |
image |
The image becomes the first frame. |
first_last_frame |
image, last_frame |
The clip starts at image and ends at last_frame. frame_interpolation is an alias. |
reference_guided |
reference_images |
1-3 images of a subject, product or person (referenceType: "asset") that should appear in the clip. Veo 3.1 Fast and Lite only; not veo-3.1-generate-001. Style references are rejected. |
video_extension |
previous_job_id (or video) |
Continues a finished clip by 7 seconds. See "Extend a Veo clip" below. |
If mode is omitted or set to auto, the gateway infers it from the media
fields: previous_job_id or video → video_extension,
reference_images → reference_guided, image + last_frame →
first_last_frame, image → image_to_video, and no media →
text_to_video.
- Audio is generated by default. Send
"audio": falsefor a silent clip, billed at the lower "without audio" rate. - Duration:
4,6or8seconds (default8). - Resolution:
720p(default) or1080p.4kis not available: such a request returns400(resolution 4k is not available ... Supported: 720p, 1080p) before anything is generated or charged. - Aspect ratio:
16:9(default) or9:16. - Clips:
n(orsample_count) from 1 to 4. - Seed: optional unsigned 32-bit integer.
- Optional controls:
negative_prompt,person_generation,resize_mode(croporpad, for image inputs),camera_control(image-driven modes only),compression_quality. - Images (
image,last_frame,reference_images[]) can be a public HTTPS URL, a data URI / base64 string, or an object such as{"url": "https://example.com/frame.png", "mime_type": "image/png"}.
The gateway does not silently downgrade a request. A combination the model cannot produce fails with a validation error; the reservation is released when the rejection happens before generation starts.
Extend a Veo clip
Send a new request with the same model, a prompt for what happens next and
previous_job_id set to the id of a finished Veo job created with your API
key. Omit image, last_frame, reference_images, video and the duration:
the extension always adds 7 seconds, so an 8-second clip becomes a 15-second
clip. The new job returns the whole extended video. The extension keeps the
source clip's resolution and aspect ratio unless you set resolution.
Extension is available for clips generated with the default settings
(8 seconds, one clip, audio on). If a particular source job cannot be extended
(another model family, not finished, not created with your key, or a clip that
was not produced in an extendable form), the request returns 400 or 409
before anything is charged. You can also extend your own clip by sending it as
video with mode: "video_extension".
Gemini Omni 1.1 Flash
Use the model ID gemini-omni-1.1-flash. The older gemini-omni-flash-preview
and gemini-omni-flash spellings are accepted as aliases and resolve to it.
The gateway does not substitute Veo or another video model.
mode |
Required input | Notes |
|---|---|---|
text_to_video |
prompt |
Default when no media is supplied. |
image_to_video |
image |
Animate one image (it becomes the first frame). |
first_last_frame |
image, last_frame |
The clip starts at image and ends at last_frame. |
reference_to_video |
reference_images |
1-3 reference images. |
edit |
previous_job_id |
Change a finished Omni clip created with your API key, described by prompt. The edited clip keeps the source clip's duration and resolution. |
- Duration:
4,6,8or10seconds (default8). - Resolution:
360por720p(default720p). - Aspect ratio:
16:9(default) or9:16. One clip per request. - Audio is always generated: omit
audioor sendtrue;audio: falseis rejected. seedis rejected for Omni rather than pretending the result is reproducible.- Omni is a video model on this endpoint only: it is not available on Chat Completions.
Request body (POST /v1/videos/generations)
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
model |
string | Yes | - | One of the video model IDs above |
prompt |
string | Yes | - | What the clip should show (for an extension: what happens next; for an edit: what to change) |
mode / task |
string | No | auto |
Workflow; see the mode tables above |
duration_seconds / duration |
integer | No | 8 |
Veo: 4, 6, 8. Omni: 4, 6, 8, 10. Omit for an extension or an edit. |
aspect_ratio / aspectRatio |
string | No | 16:9 |
16:9 or 9:16 |
resolution |
string | No | 720p |
Veo: 720p, 1080p (4k returns 400). Omni: 360p, 720p. |
audio / generateAudio |
boolean | No | true |
Veo: false for a silent clip. Omni: always true. |
n / sample_count / sampleCount |
integer | No | 1 |
Veo: 1-4. Omni: 1. |
seed |
integer | No | - | Veo only: unsigned 32-bit. |
image |
string/object | No | - | Start frame (image-to-video, first+last frame) |
last_frame / lastFrame |
string/object | No | - | End frame; requires image |
reference_images / referenceImages |
array | No | - | Up to 3 reference images (Veo Fast / Lite, Omni) |
previous_job_id |
string | No | - | Veo: clip to extend. Omni: clip to edit (mode: "edit"). Must be a finished job created with the same API key. |
video |
string/object | No | - | Veo only: your own source clip for video_extension |
negative_prompt / negativePrompt |
string | No | - | Veo only: content to avoid |
person_generation / personGeneration |
string | No | - | Veo only: person generation policy |
resize_mode / resizeMode |
string | No | - | Veo only: crop or pad for image inputs |
camera_control / cameraControl |
string | No | - | Veo only, image-driven modes |
compression_quality / compressionQuality |
string | No | - | Veo only |
Send an Idempotency-Key header so a retried submit returns the same job
instead of creating (and paying for) a second one.
Examples
All examples use https://gateway.api429.com and an API key in
YOUR_API_KEY. Every submit returns 202 with a job object; poll it as shown
in "Poll for the result".
Text-to-video (Veo 3.1 Fast)
curl -X POST "https://gateway.api429.com/v1/videos/generations" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: t2v-0001" \
-d '{
"model": "veo-3.1-fast-generate-001",
"prompt": "A calm ocean wave at sunrise, cinematic, slow dolly shot",
"duration_seconds": 8,
"aspect_ratio": "16:9",
"resolution": "1080p"
}'
Image-to-video (start frame)
curl -X POST "https://gateway.api429.com/v1/videos/generations" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: i2v-0001" \
-d '{
"model": "veo-3.1-generate-001",
"mode": "image_to_video",
"prompt": "The camera slowly pushes in while steam rises from the cup",
"image": "https://example.com/coffee.jpg",
"aspect_ratio": "9:16",
"resolution": "720p"
}'
First and last frame
curl -X POST "https://gateway.api429.com/v1/videos/generations" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "veo-3.1-lite-generate-001",
"mode": "first_last_frame",
"prompt": "A flower bud slowly opens into full bloom",
"image": "https://example.com/bud.png",
"last_frame": "https://example.com/bloom.png"
}'
Reference images (Veo 3.1 Fast / Lite)
curl -X POST "https://gateway.api429.com/v1/videos/generations" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "veo-3.1-fast-generate-001",
"mode": "reference_guided",
"prompt": "The woman from the reference walks a golden retriever through a sunny park",
"reference_images": [
"https://example.com/woman.jpg",
"https://example.com/dog.jpg"
]
}'
Extend a finished Veo clip by 7 seconds
curl -X POST "https://gateway.api429.com/v1/videos/generations" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "veo-3.1-fast-generate-001",
"mode": "video_extension",
"prompt": "The wave breaks on the shore and the camera rises above the beach",
"previous_job_id": "01HYVIDEOJOB"
}'
Gemini Omni 1.1 Flash: generate, then edit
curl -X POST "https://gateway.api429.com/v1/videos/generations" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-omni-1.1-flash",
"prompt": "A cinematic product shot of a blue ceramic cup on a wooden table",
"duration_seconds": 6,
"aspect_ratio": "16:9",
"resolution": "720p"
}'
# when that job has succeeded, edit the clip it produced:
curl -X POST "https://gateway.api429.com/v1/videos/generations" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-omni-1.1-flash",
"mode": "edit",
"prompt": "Make the cup red and add soft evening light",
"previous_job_id": "01HYOMNIJOB"
}'
Omni image-to-video uses "image"; first+last frame uses
"mode": "first_last_frame" with "image" and "last_frame"; references use
"reference_images" with 1-3 images, exactly as in the Veo examples. Edits
work on Omni clips created with your API key.
Poll for the result
Submit returns 202:
{
"id": "01HYVIDEOJOB",
"object": "video.generation.job",
"endpoint": "videos.generations",
"status": "queued",
"model": "veo-3.1-fast-generate-001",
"queue_position": 1,
"error": null
}
curl "https://gateway.api429.com/v1/videos/generations/01HYVIDEOJOB" \
-H "Authorization: Bearer YOUR_API_KEY"
While the job runs, the same job object comes back with status queued or
running. A video usually takes 1-5 minutes; poll every 10-15 seconds. Final
states:
succeeded— the response is the result:
{
"object": "video.generation",
"model": "veo-3.1-fast-generate-001",
"created": 1793500000,
"data": [
{"url": "https://cdn.example.com/video.mp4", "mime_type": "video/mp4"}
],
"billing": {
"official_amount_usd": "0.960000",
"discount_percent": "70",
"charged_amount_usd": "0.288000",
"currency": "USD",
"pricing_status": "usage"
},
"metadata": {
"job_id": "01HYVIDEOJOB",
"actual_model": "veo-3.1-fast-generate-001",
"mode": "text_to_video"
}
}
failed—error.code,error.messageanderror.http_statusexplain why; the reservation is released.ambiguous— the gateway could not confirm the outcome. Keep polling the same job; do not automatically submit a replacement paid request.
metadata.actual_model names the model that produced the clip. Amounts above
illustrate the shape; the real amounts depend on the request and your discount.
The same steps in Python:
import time
import requests
BASE = "https://gateway.api429.com"
HEADERS = {"Authorization": "Bearer YOUR_API_KEY"}
def generate_video(body: dict, idempotency_key: str) -> dict:
submit = requests.post(
f"{BASE}/v1/videos/generations",
headers={**HEADERS, "Idempotency-Key": idempotency_key},
json=body,
timeout=60,
)
submit.raise_for_status()
job_id = submit.json()["id"]
while True:
time.sleep(15)
job = requests.get(
f"{BASE}/v1/videos/generations/{job_id}", headers=HEADERS, timeout=60
).json()
status = job.get("status")
if job.get("object") == "video.generation": # succeeded
job["id"] = job_id
return job
if status in ("failed", "cancelled"):
raise RuntimeError(f"video job {job_id} {status}: {job.get('error')}")
# queued / running / ambiguous: keep polling the same job
clip = generate_video(
{
"model": "veo-3.1-fast-generate-001",
"prompt": "A paper boat drifting down a rainy street, close-up",
"aspect_ratio": "16:9",
"resolution": "720p",
},
idempotency_key="boat-001",
)
print(clip["data"][0]["url"], clip["billing"]["charged_amount_usd"])
# Extend the same clip by 7 seconds (8 s -> 15 s)
longer = generate_video(
{
"model": "veo-3.1-fast-generate-001",
"prompt": "The boat reaches a puddle and spins around",
"previous_job_id": clip["id"],
},
idempotency_key="boat-001-extend",
)
print(longer["data"][0]["url"])
# Image-to-video, first+last frame, references and Omni edits use the same
# helper: put "image", "last_frame", "reference_images" or
# {"model": "gemini-omni-1.1-flash", "mode": "edit", "previous_job_id": ...}
# into the body.
Vertex-compatible Endpoints (Veo only)
These routes are intended for clients migrating from a Vertex-style SDK or REST
integration. Keep the same request body shape and change the base URL/token.
Gemini Omni uses the API429/OpenAI-style endpoint above and is not exposed as a
Vertex predictLongRunning model.
POST /v1/projects/{project}/locations/{location}/publishers/google/models/{model}:predictLongRunning
POST /v1/projects/{project}/locations/{location}/publishers/google/models/{model}:fetchPredictOperation
Auth can be sent as x-goog-api-key: YOUR_API_KEY, ?key=YOUR_API_KEY, or
Authorization: Bearer YOUR_API_KEY.
Submit Example
curl -X POST "https://gateway.api429.com/v1/projects/gateway/locations/us-central1/publishers/google/models/veo-3.1-fast-generate-001:predictLongRunning" \
-H "x-goog-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"instances": [{"prompt": "A calm ocean wave at sunrise, cinematic"}],
"parameters": {
"durationSeconds": 4,
"sampleCount": 1,
"aspectRatio": "16:9",
"resolution": "720p"
}
}'
The gateway returns an API429-managed operation name:
{
"name": "api429/jobs/01HYVIDEOJOB",
"done": false,
"metadata": {"api429JobId": "01HYVIDEOJOB", "status": "queued"}
}
Fetch operation state:
curl -X POST "https://gateway.api429.com/v1/projects/gateway/locations/us-central1/publishers/google/models/veo-3.1-fast-generate-001:fetchPredictOperation" \
-H "x-goog-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"operationName":"api429/jobs/01HYVIDEOJOB"}'
If the feature is not enabled for your account, the route returns 403, 404,
or 503. If your balance is too low for the estimated video cost, submit
returns 402.
Quickstart: the first request · Models and prices · Get an API key