- Third-party
- Zero data retention
Veo 3.1 的快速版本,针对更低延迟进行了优化,同时保持高质量的视频和音频输出。
| 模型信息 | |
|---|---|
| 条款和许可证 | 链接 ↗ |
| 更多信息 | 链接 ↗ |
| 零数据保留 | 是 |
| 定价 | 在 Cloudflare 仪表板中查看定价 ↗ |
用法
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"
}示例
社交内容 — 适用于社交媒体的快速竖屏视频
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"
}动态图形 — 快速动画图形
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"
}氛围场景 — 舒缓的背景视频
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"
}参数
prompt
stringrequired描述要生成的视频的文本提示词image_input
string用于图生视频的 Base64 编码参考图像duration
stringrequireddefault: 6senum: 4s, 6s, 8s视频时长aspect_ratio
stringrequireddefault: 16:9enum: 16:9, 9:16, 1:1视频宽高比resolution
stringrequireddefault: 720penum: 720p, 1080p视频分辨率generate_audio
booleanrequireddefault: true是否随视频一同生成音频video
stringformat: uri生成视频的 URL