Skip to content
Google logo

Veo 3.1 Fast

Text-to-Video • Google

View as MarkdownAgent setup

Model ID

Use with the Workers AI binding, the AI Gateway REST API, or the Unified API.

Calling the provider directly? Use the provider's model name instead, including with provider-native endpoints or the provider's own SDK. For example, Anthropic's name for anthropic/claude-opus-4.8 is claude-opus-4-8.

  • Third-party
  • Zero data retention

A faster version of Veo 3.1 optimized for lower latency while maintaining high-quality video and audio output.

Model Info
Terms and Licenselink ↗
More informationlink ↗
Zero data retentionYes
Pricing
  • Default (per second)$0.08
  • @720p (per second)$0.08
  • @1080p (per second)$0.10
  • @4k (per second)$0.25
  • @720p w/ audio (per second)$0.10
  • @1080p w/ audio (per second)$0.12
  • @4k w/ audio (per second)$0.30

Usage

const response = await env.AI.run(
  'google/veo-3.1-fast',
  {
    prompt: 'A butterfly landing on a colorful flower in a garden',
    aspect_ratio: '16:9',
    duration: '6s',
    generate_audio: true,
    resolution: '720p',
  },
)
console.log(response)
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
  --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
  "model": "google/veo-3.1-fast",
  "input": {
    "prompt": "A butterfly landing on a colorful flower in a garden",
    "aspect_ratio": "16:9",
    "duration": "6s",
    "generate_audio": true,
    "resolution": "720p"
  }
}'
{
  "gatewayMetadata": {
    "keySource": "Unified"
  },
  "result": {
    "video": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/google__veo-3.1-fast/quick-demo.mp4"
  },
  "state": "Completed"
}

Examples

Social Content — Quick vertical video for social media
const response = await env.AI.run(
  'google/veo-3.1-fast',
  {
    prompt: 'Aesthetic morning routine: sun rays through curtains, coffee being poured',
    aspect_ratio: '9:16',
    duration: '6s',
    generate_audio: true,
    resolution: '720p',
  },
)
console.log(response)
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
  --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
  "model": "google/veo-3.1-fast",
  "input": {
    "prompt": "Aesthetic morning routine: sun rays through curtains, coffee being poured",
    "aspect_ratio": "9:16",
    "duration": "6s",
    "generate_audio": true,
    "resolution": "720p"
  }
}'
{
  "gatewayMetadata": {
    "keySource": "Unified"
  },
  "result": {
    "video": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/google__veo-3.1-fast/social-content.mp4"
  },
  "state": "Completed"
}
Motion Graphics — Quick animated graphics
const response = await env.AI.run(
  'google/veo-3.1-fast',
  {
    prompt: 'Glowing neon lines forming geometric patterns on a dark background',
    aspect_ratio: '16:9',
    duration: '4s',
    generate_audio: false,
    resolution: '720p',
  },
)
console.log(response)
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
  --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
  "model": "google/veo-3.1-fast",
  "input": {
    "prompt": "Glowing neon lines forming geometric patterns on a dark background",
    "aspect_ratio": "16:9",
    "duration": "4s",
    "generate_audio": false,
    "resolution": "720p"
  }
}'
{
  "gatewayMetadata": {
    "keySource": "Unified"
  },
  "result": {
    "video": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/google__veo-3.1-fast/motion-graphics.mp4"
  },
  "state": "Completed"
}
Ambient Scene — Relaxing background video
const response = await env.AI.run(
  'google/veo-3.1-fast',
  {
    prompt: 'Rain falling on a window with a blurred city skyline in the background at night',
    aspect_ratio: '16:9',
    duration: '8s',
    generate_audio: true,
    resolution: '720p',
  },
)
console.log(response)
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
  --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
  "model": "google/veo-3.1-fast",
  "input": {
    "prompt": "Rain falling on a window with a blurred city skyline in the background at night",
    "aspect_ratio": "16:9",
    "duration": "8s",
    "generate_audio": true,
    "resolution": "720p"
  }
}'
{
  "gatewayMetadata": {
    "keySource": "Unified"
  },
  "result": {
    "video": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/google__veo-3.1-fast/ambient-scene.mp4"
  },
  "state": "Completed"
}

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
video
stringformat: uriURL to the generated video

API Schemas (Raw)

Input
Output

Was this helpful?