Pular para o conteúdo
Google logo

Veo 3

Text-to-Video • Google

Ver como Markdown
  • Third-party
  • Zero data retention

Google's video generation model capable of producing high-quality videos with optional audio from text prompts.

Model Info
Terms and License link
More information link
Zero data retentionYes
Pricing View pricing in the Cloudflare dashboard

Usage

const response = await env.AI.run(
  'google/veo-3',
  {
    prompt: 'A golden retriever running through a field of sunflowers on a sunny day',
    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",
  "input": {
    "prompt": "A golden retriever running through a field of sunflowers on a sunny day",
    "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/simple-video-generation.mp4"
  },
  "state": "Completed"
}

Examples

Cinematic Scene — Widescreen cinematic video in 1080p
const response = await env.AI.run(
  'google/veo-3',
  {
    prompt:
      'A dramatic drone shot flying through misty mountain peaks at sunrise, with clouds rolling through valleys below',
    aspect_ratio: '16:9',
    duration: '8s',
    generate_audio: true,
    resolution: '1080p',
  },
)
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",
  "input": {
    "prompt": "A dramatic drone shot flying through misty mountain peaks at sunrise, with clouds rolling through valleys below",
    "aspect_ratio": "16:9",
    "duration": "8s",
    "generate_audio": true,
    "resolution": "1080p"
  }
}'
{
  "gatewayMetadata": {
    "keySource": "Unified"
  },
  "result": {
    "video": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/google__veo-3/cinematic-scene.mp4"
  },
  "state": "Completed"
}
Vertical Video — Portrait orientation for social media
const response = await env.AI.run(
  'google/veo-3',
  {
    prompt: 'A barista expertly pouring latte art, close-up shot with shallow depth of field',
    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",
  "input": {
    "prompt": "A barista expertly pouring latte art, close-up shot with shallow depth of field",
    "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/vertical-video.mp4"
  },
  "state": "Completed"
}
Short Format — Short video for social media posts
const response = await env.AI.run(
  'google/veo-3',
  {
    prompt: 'A timelapse of a flower blooming, soft natural lighting',
    aspect_ratio: '16:9',
    duration: '4s',
    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",
  "input": {
    "prompt": "A timelapse of a flower blooming, soft natural lighting",
    "aspect_ratio": "16:9",
    "duration": "4s",
    "generate_audio": true,
    "resolution": "720p"
  }
}'
{
  "gatewayMetadata": {
    "keySource": "Unified"
  },
  "result": {
    "video": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/google__veo-3/short-format.mp4"
  },
  "state": "Completed"
}
Silent Video — Video without audio generation
const response = await env.AI.run(
  'google/veo-3',
  {
    prompt: 'Abstract flowing liquid metal morphing into geometric shapes',
    aspect_ratio: '16:9',
    duration: '6s',
    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",
  "input": {
    "prompt": "Abstract flowing liquid metal morphing into geometric shapes",
    "aspect_ratio": "16:9",
    "duration": "6s",
    "generate_audio": false,
    "resolution": "720p"
  }
}'
{
  "gatewayMetadata": {
    "keySource": "Unified"
  },
  "result": {
    "video": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/google__veo-3/silent-video.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