Skip to content
Dashboard

Veo 3.1 Lite Generate

Veo 3.1 Lite Generate is the cost-optimized tier of the Veo 3.1 family, supporting text-to-video and image-to-video with native audio at 720p and 1080p, built for high-volume video applications that generate continuously rather than one deliverable at a time. Your use is subject to Google's Terms & Privacy Policies.

text-to-video
import { experimental_generateVideo as generateVideo } from 'ai';
const result = await generateVideo({
model: 'google/veo-3.1-lite-generate-001',
prompt: 'A serene mountain lake at sunrise.'
});
Read docs

Getting started

Generate videos with Veo 3.1 Lite Generate using the experimental_generateVideo function from AI SDK 6 or later. AI Gateway handles routing and polls until the video is ready.

Install the AI SDK (pnpm add ai dotenv), create an API key from the API Keys page, and set it as AI_GATEWAY_API_KEY in your environment. Full setup is covered in the video generation quickstart.

index.ts
import { experimental_generateVideo as generateVideo } from 'ai';
import fs from 'node:fs';
import 'dotenv/config';
async function main() {
const result = await generateVideo({
model: 'google/veo-3.1-lite-generate-001',
prompt: 'A drone shot of a coastal cliff with crashing waves at golden hour.',
});
// Save the generated video
fs.writeFileSync('output.mp4', result.videos[0].uint8Array);
console.log('Video saved to output.mp4');
}
main().catch(console.error);

Top-level parameters

Load the common, top-level parameters supported across video models.

top-level-params.ts
import { experimental_generateVideo as generateVideo } from 'ai';
import fs from 'node:fs';
import 'dotenv/config';
async function main() {
const result = await generateVideo({
model: 'google/veo-3.1-lite-generate-001',
prompt: 'A drone shot of a coastal cliff with crashing waves at golden hour.',
duration: 5,
aspectRatio: '16:9',
resolution: '1280x720',
});
// Save the generated video
fs.writeFileSync('output.mp4', result.videos[0].uint8Array);
console.log('Video saved to output.mp4');
}
main().catch(console.error);
ParameterTypeRequiredDescription
promptstringNoText description of the video to generate.
duration4 | 6 | 8NoVideo length in seconds. 4 or 6 or 8 seconds.
resolutionstringNoResolution ('1280x720', '1920x1080').
aspectRatiostringNoAspect ratio ('9:16', '16:9').

Input limits

InputFormatsSourcesMax countMax sizeLimits
Imagejpg, jpeg, pngurl, base64320 MB
Videomp4url1

Provider options

Pass provider-specific options under providerOptions.vertex.

provider-options.ts
import { experimental_generateVideo as generateVideo } from 'ai';
import fs from 'node:fs';
import 'dotenv/config';
async function main() {
const result = await generateVideo({
model: 'google/veo-3.1-lite-generate-001',
prompt: 'A drone shot of a coastal cliff with crashing waves at golden hour.',
duration: 5,
providerOptions: {
vertex: {
pollTimeoutMs: 600000,
},
},
});
// Save the generated video
fs.writeFileSync('output.mp4', result.videos[0].uint8Array);
console.log('Video saved to output.mp4');
}
main().catch(console.error);

Pass these under providerOptions.vertex in your generateVideo call.

ParameterTypeRequiredDescription
providerOptions.vertex.pollIntervalMsnumberNoHow often to check task status. Defaults to 5000.
providerOptions.vertex.pollTimeoutMsnumberNoMaximum wait time. Defaults to 600000 (10 minutes).