Skip to main content

Overview

Veo 3.1 official API forwarding is now available through api2.laozhang.ai and is compatible with the OpenAI Videos API style. For new integrations, create a dedicated token, keep it in the default group, and set Billing mode to Pay-per-request. This page documents the API format, parameters, pricing, and code examples.

Pricing Advantage

Veo 3.1 official forwarding uses Pay-per-request billing with one unified price across supported duration and resolution combinations. Duration and resolution do not add extra charges. Based on public pricing from Google Gemini API Pricing, Google bills Veo 3.1 per second; the comparison below uses 8-second videos. This route uses the same OpenAI Videos API style as Sora2 official forwarding: Use the OpenAI SDK for text-to-video and single first-frame image-to-video. Upload local image files with input_reference. For first/last-frame generation, use a JSON request body with images and metadata.lastFrame Data URIs. Do not treat multi-reference-image fields as production-ready capabilities yet.
On 2026-06-27, retesting with the upstream JSON example verified that images[] + metadata.lastFrame produces videos matching both the first and last frame. Both 720p and 1080p passed frame extraction checks. The field is case-sensitive: use lastFrame, not lastframe; the request body must be JSON, not multipart; pass duration as the string "8", not the number 8. metadata.referenceImages still returns referenceImage isn't supported by this model, so multi-reference images remain unavailable.
Do not use the legacy Veo-3.1 sync route, legacy Chat Completions examples, or old model names such as veo-3.1, veo-3.1-fast, or veo-3.1-fl. The official-forward route only uses the model names and /v1/videos task API documented here.

Token Setup

Veo 3.1 official forwarding uses the Pay-per-request billing mode across supported duration and resolution combinations. Duration and resolution do not add extra charges.

Supported Models

OpenAI SDK Quick Start

For text-to-video and single-image image-to-video, use the OpenAI SDK first. Set base_url to https://api2.laozhang.ai/v1.
For single-image image-to-video, pass the local file as input_reference:

Parameters

Core Parameters

Do not pass generateAudio. Veo 3 / Veo 3.1 models have native audio, but this API does not support audio toggling through generateAudio. Passing it may return INVALID_ARGUMENT. To guide audio content, describe dialogue, ambient sound, effects, or music style in the prompt.

Duration and Resolution

Pass seconds and duration as strings rather than numbers. Use 720p + 4s for quick tests. For production integrations, use 8-second requests. 1080p and 4k only support 8 seconds. For image-to-video, upload a local image file instead of a remote image URL.
Parameter limit: 1080p and 4k must be used with 8-second requests. Do not combine them with 4-second or 6-second requests. For 4K, also pass metadata.resolution="4k"; otherwise the downloaded file may be rendered as 1080p.
4K requests use the unified price. If you need to verify native 4K output, download the MP4 and inspect its media metadata. Do not rely only on create-task parameters for final file resolution.

Text-to-Video

Create a Task

Create Response

Image-to-Video

Image-to-video uses the same create endpoint. Single first-frame image-to-video uses multipart input_reference; first/last-frame generation uses JSON images[] + metadata.lastFrame. Do not use multipart last_frame / lastFrame file fields as a replacement for JSON metadata.lastFrame.

4K Landscape Image-to-Video

For 4K landscape image-to-video, upload a 16:9 reference image and pass both resolution="4k" and metadata.resolution="4k".

First/Last-Frame Generation

First/last-frame generation must use a JSON request body. Pass the first frame as a Data URI inside images, and pass the last frame as a Data URI inside metadata.lastFrame. Pass duration as a string, such as "8", so OpenAI-compatible gateways do not reject the numeric type. In testing, size="1920x1080" and duration="8" returned a 1920x1080, 8-second MP4 with extracted first and final frames matching the inputs.

Multi-Reference Images

Multi-reference images are currently unavailable. When sent as metadata.referenceImages following the upstream example, both Fast and Standard models return referenceImage isn't supported by this model / INVALID_ARGUMENT. Do not expose material reference images in production; use the JSON metadata.lastFrame path above for first/last-frame generation.

Video Extension

Video extension uses the video file field to upload an existing MP4. Use 8-second requests. This mode continues the style and content from the uploaded video according to your prompt; it does not guarantee frame-perfect stitching.
Reference image dimensions should match the target size when possible. For example, use a 1280x720 image when size=1280x720. JPEG, PNG, and WebP are supported. For video extension, upload an MP4 file and use streaming downloads with retries for the result.

Poll Status

Save the id or task_id from the create response, then poll status.
In progress:
Completed:

Status Values

Compatibility Status Polling

If existing code uses the older video generations polling path, use this compatibility endpoint:
This endpoint returns a task status object:
The compatibility polling endpoint does not return a separate public video URL. Download video results through /v1/videos/{id}/content.

Download Video

After the task completes, use /content to retrieve MP4 bytes. The API returns video file bytes, not a public video URL.
The video file may lag briefly after GET /v1/videos/{id} returns completed. If the content endpoint returns task status is IN_PROGRESS, a 400 JSON response, or a short-lived stream interruption, wait 10-20 seconds and retry. For 4K outputs, use streaming downloads and retries.

Python Complete Example

FAQ

/v1/videos/{id}/content returns video/mp4 bytes, not a public video URL. /v1/video/generations/{id} returns a task status object, not a separate public video URL. In production, download it server-side, store it in your own OSS/CDN, and return your own URL to users.
Use the default group for Veo 3.1 official forwarding. Create a dedicated token and set Billing mode to Pay-per-request for cleaner billing review.
Billing uses Pay-per-request, not separate duration or resolution pricing. veo-3.1-fast-generate-preview is $0.3/call, and veo-3.1-generate-preview is $1.2/call. For production integrations, use 8-second requests; 1080p and 4k require 8 seconds. For 4K, also pass metadata.resolution="4k".
Two verified image-control paths are available: single first-frame generation with multipart input_reference, and first/last-frame generation with JSON images[] + metadata.lastFrame. Do not expose metadata.referenceImages as a material-reference feature right now; upstream currently returns referenceImage unsupported.
Yes. Upload an MP4 through the video file field and use seconds="8" plus duration="8". Video extension continues style and content from the uploaded video according to your prompt; it does not guarantee frame-perfect stitching.
Do not pass generateAudio. Veo 3 / Veo 3.1 models have native audio, but this API does not support toggling audio with generateAudio; describe the desired audio in the prompt instead.
Not recommended. Veo 3.1 official forwarding should use the same /v1/videos task API style as Sora2 official forwarding.