Veo 视频生成
Google Veo 是 Google DeepMind 推出的高性能视频生成模型,能够根据文本描述或参考图片生成高质量、高分辨率的视频内容,画面流畅自然、细节丰富。
在线体验
快速开始
使用 cURL 快速发起一个视频生成请求:
bash
curl -X POST https://open.dieyuyun.com/v1/video/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "veo-3",
"prompt": "一只金毛犬在海边奔跑,夕阳西下,电影级画质",
"size": "1280x720",
"duration": 5
}'请求端点
| 项目 | 值 |
|---|---|
| 方法 | POST |
| 路径 | /v1/video/generations |
| Base URL | https://open.dieyuyun.com |
| 兼容协议 | OpenAI-compatible |
认证
所有请求均需在请求头中携带 API Key:
http
Authorization: Bearer YOUR_API_KEY标准请求字段
| 字段 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| model | string | 是 | — | 模型标识,如 veo-3 |
| prompt | string | 是 | — | 视频内容描述,建议包含场景、动作、风格等细节 |
| size | string | 否 | 1280x720 | 视频分辨率,支持 1280x720、720x1280、1920x1080 |
| duration | integer | 否 | 5 | 视频时长(秒),支持 5 或 8 |
| image | string | 否 | — | 参考图片 URL,用于图片生成视频(图生视频模式) |
请求示例
bash
curl -X POST https://open.dieyuyun.com/v1/video/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "veo-3",
"prompt": "城市夜景,霓虹灯闪烁,车流穿梭,航拍视角",
"size": "1920x1080",
"duration": 8
}'python
import requests
response = requests.post(
"https://open.dieyuyun.com/v1/video/generations",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
json={
"model": "veo-3",
"prompt": "城市夜景,霓虹灯闪烁,车流穿梭,航拍视角",
"size": "1920x1080",
"duration": 8
}
)
task = response.json()
task_id = task["task_id"]
print(f"任务已创建: {task_id}")javascript
const response = await fetch('https://open.dieyuyun.com/v1/video/generations', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
model: 'veo-3',
prompt: '城市夜景,霓虹灯闪烁,车流穿梭,航拍视角',
size: '1920x1080',
duration: 8,
}),
})
const task = await response.json()
console.log('任务已创建:', task.task_id)响应格式
视频生成为异步任务,提交后返回任务 ID,需轮询获取结果。
任务创建响应
json
{
"task_id": "task_abc123",
"status": "queued",
"progress": 0,
"created_at": "2025-01-15T10:30:00Z"
}轮询任务状态
bash
curl https://open.dieyuyun.com/v1/video/generations/task_abc123 \
-H "Authorization: Bearer YOUR_API_KEY"任务完成响应
json
{
"task_id": "task_abc123",
"status": "completed",
"progress": 100,
"metadata": {
"url": "https://cdn.dieyuyun.com/videos/task_abc123.mp4",
"duration": 8,
"size": "1920x1080"
},
"completed_at": "2025-01-15T10:32:00Z"
}轮询示例
python
import time
import requests
# 提交任务
resp = requests.post(
"https://open.dieyuyun.com/v1/video/generations",
headers={"Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json"},
json={"model": "veo-3", "prompt": "一只猫在弹钢琴", "duration": 5}
)
task_id = resp.json()["task_id"]
# 轮询结果
while True:
status = requests.get(
f"https://open.dieyuyun.com/v1/video/generations/{task_id}",
headers={"Authorization": "Bearer YOUR_API_KEY"}
).json()
if status["status"] == "completed":
print(f"视频地址: {status['metadata']['url']}")
break
elif status["status"] == "failed":
print("生成失败")
break
time.sleep(5)异步任务
视频生成为异步任务。完整的任务轮询流程、状态说明和最佳实践,请参阅 异步任务。
最佳实践
- 描述具体化:在 prompt 中明确场景、主体、动作、光线和镜头运动,如"航拍视角下,一片金色麦田在微风中摇曳,黄昏光线"
- 合理设置时长:较短的时长(5秒)生成速度更快、成本更低,适合测试;确认效果后再使用 8 秒
- 图生视频:提供高质量参考图片可显著提升生成一致性和画面质量
- 异步轮询:视频生成通常需要 1-5 分钟,建议每 5 秒轮询一次任务状态
速率限制
| 限制项 | 值 |
|---|---|
| 每分钟请求数 | 5 RPM |
| 每日请求数 | 100 次/天 |
| 并发任务数 | 2 |
如需更高限额,请在 控制台 提交工单申请。