3-Step Video Generation Workflow
Step 1: Initiate Video Generation
Request a new video generation task by calling the:predictLongRunning RPC on the model.
Response
Step 2: Poll for Completion
Using the operation ID returned from Step 1, poll the status endpoint until"done": true is returned.
Response (Once Completed)
Step 3: Download Video
Substitute the Google API host (https://generativelanguage.googleapis.com/v1beta) with the proxy base URL (https://api.znapai.com/gemini/v1beta) to route the download request through ZnapAI.
Supported Generation Modes
Model Feature Support
As tested through this proxy,veo-3.1-generate-preview and veo-3.1-fast-generate-preview behave identically for every feature below; veo-3.1-lite-generate-preview differs on reference images and negative prompt.
First & Last Frame Generation (Interpolation)
You can generate a video transition between two images (a starting state and an ending state) by providing both a first frame and a last frame:- First Frame: Can be passed via
instances[0].firstFrameorinstances[0].image. - Last Frame: Must be passed via
instances[0].lastFrame.
Unlike
referenceImages, first/last frame interpolation is supported across all three model variants: veo-3.1-generate-preview, veo-3.1-lite-generate-preview, and veo-3.1-fast-generate-preview.Reference Images (Subject Consistency)
You can guide the appearance of a subject (e.g. a character or object) across the generated video by providing 1–3 reference images viainstances[0].referenceImages, each with a referenceType of "asset".
Example Request:
Video Extension
You can extend a previously generated Veo video by 7 seconds (repeatable up to 20 times) by passing it viainstances[0].video.
Example Request:
Chaining Extensions (Extend Again)
To extend a video more than once, take theuri from the most recent extension’s completed poll response — not the original input video — and pass that into the next extension request. The call shape is identical each time; only the uri and prompt change.
Confirmed working: extending an already-extended video succeeds the same way as the first extension, with no different payload shape or extra fields required. Each successful call adds another ~7 seconds and returns a new
uri to chain from for the next call, up to 20 times total.Parameter Specifications
Optional Parameters
string
A text description of the video you want to generate.
object
Input image for Image-to-Video generation. Can also be used as the starting
(first) frame when paired with
lastFrame.object
Input image to guide the ending (last) frame of the video, enabling smooth
transition/interpolation between the first and last frames.
object
A previously Veo-generated video to extend by 7 seconds. Must be passed as
{"uri": "<file-download-url>"}, not as raw bytes.array
A list of 1–3 images used to guide the appearance of a subject (e.g. a character or object) across the generated video. Each entry needs a
referenceType of "asset".integer
The length of the generated video in seconds. Supported values:
4, 6, or 8.If using first-to-last frame interpolation, the duration must be set to exactly 8 seconds; shorter durations are not supported.
string
The aspect ratio of the output video. Supported values:
"16:9", "9:16".string
The resolution of the output video. E.g.,
"720p".integer
A seed value to guide the randomness of generation.
string
Description of elements you want to avoid in the video.
Validation & Error Behaviour
Negative Prompt Validation on Lite Model
Passing anegativePrompt parameter to the veo-3.1-lite-generate-preview model will result in a 400 Bad Request error:
Reference Images Limit
Providing more than 3 reference images will result in a validation error:- Observed Behaviour: 1–3 reference images are accepted; 4 or more reference images are rejected.
Reference Images Model Support
referenceImages (schema: image.bytesBase64Encoded + referenceType: "asset") was tested against all three model variants. The key finding: it works on the full and fast models, but only with durationSeconds: 8 — passing 4 (or 6) triggers a generic error that looks like a model-support issue but is actually a duration mismatch.
veo-3.1-lite-generate-preview always rejects with a model-specific message, regardless of duration:
veo-3.1-generate-preview and veo-3.1-fast-generate-preview reject with this generic message only when durationSeconds isn’t 8:
- Observed Behaviour: With
durationSeconds: 8set (orparametersomitted entirely), both the full and fast models return200and complete generation successfully. The lite model rejects unconditionally, confirming it’s a genuine capability gap rather than a duration issue.
inlineData Image Encoding Rejected
Google’s SDKs/REST examples wrap image bytes as image: { inlineData: { mimeType, data } }. This proxy does not accept that shape for any image field — use bytesBase64Encoded instead:
Video Extension Validation
instances[0].video must reference a previously Veo-generated video by its file download URI — passing raw video bytes fails:
veo-3.1-lite-generate-preview rejects video extension outright:
- Observed Behaviour:
{"video": {"uri": "<file-download-url>"}}succeeds and completes on bothveo-3.1-generate-previewandveo-3.1-fast-generate-preview.veo-3.1-lite-generate-previewrejects the request regardless of payload shape. Chaining a second extension off an already-extended video’suriwas also tested and completes successfully, with an identical request shape to the first extension.
Validation Scenarios
Unsupported Fields
fileData
PassingfileData (such as fileUri or mimeType inside the video object) is explicitly unsupported:
