Skip to content
Google logo

Veo 3.1

Text-to-VideoGoogleProxied

Google's latest video generation model with improved quality, motion, and audio generation.

Model Info
Terms and Licenselink
More informationlink

Usage

TypeScript
const response = await env.AI.run(
'google/veo-3.1',
{
prompt:
'A majestic eagle soaring over snow-capped mountains, tracking shot following the bird as it glides through clouds',
duration: '8s',
aspect_ratio: '16:9',
resolution: '1080p',
generate_audio: true,
},
{
gateway: { id: 'default' },
}
)
console.log(response)
Response 200

Examples

Urban Time-lapse — City life time-lapse video
TypeScript
const response = await env.AI.run(
'google/veo-3.1',
{
prompt:
'A time-lapse of a busy city intersection at night, car lights creating streaks, people walking in fast motion',
duration: '6s',
aspect_ratio: '16:9',
resolution: '1080p',
generate_audio: true,
},
{
gateway: { id: 'default' },
}
)
console.log(response)
Response 200
Abstract Art — Abstract motion graphics
TypeScript
const response = await env.AI.run(
'google/veo-3.1',
{
prompt:
'Colorful ink drops falling into water in slow motion, creating organic swirling patterns',
duration: '6s',
aspect_ratio: '16:9',
resolution: '720p',
generate_audio: false,
},
{
gateway: { id: 'default' },
}
)
console.log(response)
Response 200
Food Video — Appetizing food footage
TypeScript
const response = await env.AI.run(
'google/veo-3.1',
{
prompt:
'Melted chocolate being poured over fresh strawberries in slow motion, rich and glossy',
duration: '4s',
aspect_ratio: '9:16',
resolution: '1080p',
generate_audio: true,
},
{
gateway: { id: 'default' },
}
)
console.log(response)
Response 200

Parameters

prompt
stringrequiredText prompt describing the video to generate
image_input
stringBase64-encoded reference image for i2v
duration
stringrequireddefault: 6senum: 4s, 6s, 8sVideo duration
aspect_ratio
stringrequireddefault: 16:9enum: 16:9, 9:16, 1:1Video aspect ratio
resolution
stringrequireddefault: 720penum: 720p, 1080pVideo resolution
generate_audio
booleanrequireddefault: trueWhether to generate audio with the video

API Schemas

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"prompt": {
"description": "Text prompt describing the video to generate",
"type": "string"
},
"image_input": {
"description": "Base64-encoded reference image for i2v",
"type": "string"
},
"duration": {
"description": "Video duration",
"default": "6s",
"type": "string",
"enum": [
"4s",
"6s",
"8s"
]
},
"aspect_ratio": {
"description": "Video aspect ratio",
"default": "16:9",
"type": "string",
"enum": [
"16:9",
"9:16",
"1:1"
]
},
"resolution": {
"description": "Video resolution",
"default": "720p",
"type": "string",
"enum": [
"720p",
"1080p"
]
},
"generate_audio": {
"description": "Whether to generate audio with the video",
"default": true,
"type": "boolean"
}
},
"required": [
"prompt",
"duration",
"aspect_ratio",
"resolution",
"generate_audio"
],
"additionalProperties": false
}