curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "Veo3.1-quality-official",
"prompt": "海豚在碧藍海洋中跳躍,濺起水花,陽光灑在海面上",
"duration": 8,
"size": "16:9",
"resolution": "1080p",
"metadata": {
"generateAudio": true,
"negativePrompt": "模糊, 低質量"
}
}'
import requests
response = requests.post(
"https://toapis.com/v1/videos/generations",
headers={
"Authorization": "Bearer your-ToAPIs-key",
"Content-Type": "application/json"
},
json={
"model": "Veo3.1-quality-official",
"prompt": "海豚在碧藍海洋中跳躍,濺起水花,陽光灑在海面上",
"duration": 8,
"size": "16:9",
"resolution": "1080p",
"metadata": {
"generateAudio": True,
"negativePrompt": "模糊, 低質量"
}
}
)
task = response.json()
print(f"任務 ID: {task['id']}")
print(f"狀態: {task['status']}")
const response = await fetch('https://toapis.com/v1/videos/generations', {
method: 'POST',
headers: {
'Authorization': 'Bearer your-ToAPIs-key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'Veo3.1-quality-official',
prompt: '海豚在碧藍海洋中跳躍,濺起水花,陽光灑在海面上',
duration: 8,
size: '16:9',
resolution: '1080p',
metadata: {
generateAudio: true,
negativePrompt: '模糊, 低質量'
}
})
});
const task = await response.json();
console.log(`任務 ID: ${task.id}`);
console.log(`狀態: ${task.status}`);
{
"id": "video_01K8SGYNNNVBQTXNR4MM964S7K",
"object": "generation.task",
"model": "Veo3.1-quality-official",
"status": "queued",
"progress": 0,
"created_at": 1768380224,
"metadata": {}
}
Veo3 Official (including Veo3.1 Lite)
Veo3 Official 視頻生成
使用 Google Veo3 官方直連模型生成高質量視頻,支持音頻生成、首尾幀控制等高級功能
POST
/
v1
/
videos
/
generations
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "Veo3.1-quality-official",
"prompt": "海豚在碧藍海洋中跳躍,濺起水花,陽光灑在海面上",
"duration": 8,
"size": "16:9",
"resolution": "1080p",
"metadata": {
"generateAudio": true,
"negativePrompt": "模糊, 低質量"
}
}'
import requests
response = requests.post(
"https://toapis.com/v1/videos/generations",
headers={
"Authorization": "Bearer your-ToAPIs-key",
"Content-Type": "application/json"
},
json={
"model": "Veo3.1-quality-official",
"prompt": "海豚在碧藍海洋中跳躍,濺起水花,陽光灑在海面上",
"duration": 8,
"size": "16:9",
"resolution": "1080p",
"metadata": {
"generateAudio": True,
"negativePrompt": "模糊, 低質量"
}
}
)
task = response.json()
print(f"任務 ID: {task['id']}")
print(f"狀態: {task['status']}")
const response = await fetch('https://toapis.com/v1/videos/generations', {
method: 'POST',
headers: {
'Authorization': 'Bearer your-ToAPIs-key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'Veo3.1-quality-official',
prompt: '海豚在碧藍海洋中跳躍,濺起水花,陽光灑在海面上',
duration: 8,
size: '16:9',
resolution: '1080p',
metadata: {
generateAudio: true,
negativePrompt: '模糊, 低質量'
}
})
});
const task = await response.json();
console.log(`任務 ID: ${task.id}`);
console.log(`狀態: ${task.status}`);
{
"id": "video_01K8SGYNNNVBQTXNR4MM964S7K",
"object": "generation.task",
"model": "Veo3.1-quality-official",
"status": "queued",
"progress": 0,
"created_at": 1768380224,
"metadata": {}
}
中國大陸用戶請注意: 中國大陸用戶請使用
https://toapis.cn 作為接口地址(Base URL)。文檔示例中的 https://toapis.com 請替換為 https://toapis.cn。- 異步處理模式,返回任務ID用於後續查詢
- 直連 Google Vertex AI,支持 Veo 原生全部參數
- 支持文生視頻、圖生視頻、首尾幀插值等多種生成模式
- 生成的視頻鏈接,有效期爲24小時,請儘快保存
重要變更:爲了更好的性能和成本控制,我們不再支持在
image_urls 中直接傳入 base64 圖片數據。請先使用 上傳圖片接口 上傳圖片,獲取 URL 後再調用本接口。Authorizations
string
必填
所有接口均需要使用Bearer Token進行認證獲取 API Key:訪問 API Key 管理頁面 獲取您的 API Key使用時在請求頭中添加:
Authorization: Bearer YOUR_API_KEY
Body
string
預設值:"Veo3.1-quality-official"
必填
視頻生成模型名稱可用模型:
Veo3.1-quality-official- 高質量生成模型,適用於最終制作Veo3.1-fast-official- 快速生成模型,適用於快速預覽和迭代Veo3.1-lite-official- Lite 720p Example:"Veo3.1-quality-official"
string
必填
視頻生成的文本描述
integer
視頻時長(秒)支持的值:
4- 4 秒6- 6 秒8- 8 秒(默認)
string
視頻寬高比支持的格式:
16:9(橫屏,默認)9:16(豎屏)
string
視頻分辨率支持的值:
720p(默認)1080p4k(預覽)
string[]
圖生視頻的首幀參考圖,視頻將從該圖像開始生成。僅使用數組中的第一個 URL。⚠️ 僅支持 URL 格式(不再支持 base64)
- 公開可訪問的圖像 URL(http:// 或 https://)
- 可使用 上傳圖片接口 上傳本地圖片獲取 URL
- 最大文件大小:10MB
- 支持格式:.jpeg、.jpg、.png、.webp
image_urls 與 metadata.referenceImages 不可同時使用。如果同時傳入,image_urls(首幀)優先,referenceImages 將被忽略。object
Veo3 Official 特有擴展參數
顯示 顯示 metadata 字段
顯示 顯示 metadata 字段
boolean
是否生成音頻。默認:
false啓用後視頻將包含 AI 生成的音效和環境音string
負面提示詞,描述不希望在視頻中出現的內容Example:
"模糊, 低質量, 畸變"string
人物生成安全設置支持的值:
allow_adult- 允許生成成年人dont_allow- 不允許生成人物
string
尾幀圖片 URL,用於首尾幀插值生成視頻必須與
image_urls(首幀)配合使用,生成從首幀到尾幀的過渡視頻。單獨使用無效。string[]
素材/風格參考圖 URL 數組,視頻內容將參考這些圖片的視覺風格和元素進行生成(不作爲視頻起始幀)限制:最多 3 張⚠️ 不可與
image_urls 同時使用——二者在 Veo API 中互斥。如需首幀控制,請使用 image_urls。string
視頻壓縮質量支持的值:
optimized(默認)- 優化壓縮lossless- 無損壓縮
string
圖生視頻時的圖片調整模式支持的值:
pad- 填充模式,保持原始比例crop- 裁剪模式,填滿畫面
Response
string
任務唯一標識符,用於查詢任務狀態
string
對象類型,固定爲
generation.taskstring
使用的模型名稱
string
任務狀態
queued- 排隊等待處理in_progress- 處理中completed- 成功完成failed- 失敗
integer
任務進度百分比(0-100)
integer
任務創建時間戳(Unix 時間戳)
object
任務元數據
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "Veo3.1-quality-official",
"prompt": "海豚在碧藍海洋中跳躍,濺起水花,陽光灑在海面上",
"duration": 8,
"size": "16:9",
"resolution": "1080p",
"metadata": {
"generateAudio": true,
"negativePrompt": "模糊, 低質量"
}
}'
import requests
response = requests.post(
"https://toapis.com/v1/videos/generations",
headers={
"Authorization": "Bearer your-ToAPIs-key",
"Content-Type": "application/json"
},
json={
"model": "Veo3.1-quality-official",
"prompt": "海豚在碧藍海洋中跳躍,濺起水花,陽光灑在海面上",
"duration": 8,
"size": "16:9",
"resolution": "1080p",
"metadata": {
"generateAudio": True,
"negativePrompt": "模糊, 低質量"
}
}
)
task = response.json()
print(f"任務 ID: {task['id']}")
print(f"狀態: {task['status']}")
const response = await fetch('https://toapis.com/v1/videos/generations', {
method: 'POST',
headers: {
'Authorization': 'Bearer your-ToAPIs-key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'Veo3.1-quality-official',
prompt: '海豚在碧藍海洋中跳躍,濺起水花,陽光灑在海面上',
duration: 8,
size: '16:9',
resolution: '1080p',
metadata: {
generateAudio: true,
negativePrompt: '模糊, 低質量'
}
})
});
const task = await response.json();
console.log(`任務 ID: ${task.id}`);
console.log(`狀態: ${task.status}`);
{
"id": "video_01K8SGYNNNVBQTXNR4MM964S7K",
"object": "generation.task",
"model": "Veo3.1-quality-official",
"status": "queued",
"progress": 0,
"created_at": 1768380224,
"metadata": {}
}