Gemini Omni Flash
Gemini Omni 1.2 普通版
普通版支援文生影片和圖生影片, 4-15 秒時長 / 720p. 最多使用 5 張參考圖, 支援首尾幀.
普通版支援文生影片和圖生影片, 4-15 秒時長 / 720p. 最多使用 5 張參考圖, 支援首尾幀.
使用平台 API Key, 不使用上游供應商 Key. 中國大陸可將 Base URL 換為 https://toapis.cn.
請求參數
Authorizationstring請求頭必填Bearer YOUR_API_KEY
modelstring請求體必填gemini-omni-1.2-flash-preview
promptstring請求體必填必填的影片描述.
durationinteger請求體預設值: 10影片時長 4-15 秒, 不傳預設 10 秒.
resolutionstring請求體預設值: 720p720p
aspect_ratiostring請求體預設值: 16:9支援 16:9 或 9:16, 預設 16:9.
image_urlsstring[]請求體最多 5 張公開圖片 URL, 用作參考圖.
first_image_urlstring請求體首幀圖片的公開 URL.
last_image_urlstring請求體尾幀圖片的公開 URL.
本地素材請先上傳以取得公開 URL. 不傳 base64, data URI 或本地檔案路徑. 不支援影片輸入.
請求範例
curl https://toapis.com/v1/videos \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"model": "gemini-omni-1.2-flash-preview",
"prompt": "A cinematic tracking shot through a sunlit city",
"duration": 10,
"resolution": "720p",
"aspect_ratio": "16:9",
"image_urls": ["https://example.com/image.png"]
}'首尾幀範例
curl https://toapis.com/v1/videos \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"model": "gemini-omni-1.2-flash-preview",
"prompt": "根據首尾幀生成影片",
"duration": 6,
"first_image_url": "https://example.com/first.png",
"last_image_url": "https://example.com/last.png"
}'查詢結果
提交返回平台任務 id. 透過 GET /v1/videos/{id} 查詢, 完成後讀取影片結果. 不要使用供應商 task_id 或直接訪問供應商查詢接口.
curl https://toapis.com/v1/videos/YOUR_TASK_ID \
-H 'Authorization: Bearer YOUR_API_KEY'響應示例
{
"id": "vid_example",
"object": "generation.task",
"model": "gemini-omni-1.2-flash-preview",
"status": "queued",
"created_at": 1789600000
}