把影片 URL 傳給 Gemini, 可做內容摘要 / 分鏡描述 / 問答 / 字幕生成
POST /v1/chat/completions
鉴权: {'type': 'bearer', 'prefix': 'sk-', 'description': 'API Key, 使用 `Authorization: Bearer sk-xxx` 鉴权'}
Gemini 支援影片輸入, 通過 `content` 的 `input_video` / `video_url` 類型傳入。 **支援格式**: mp4 / mov / avi / webm / flv / mkv / 3gp **影片上限**: - 2.5 Pro: 2 小時 (標準解析度), 6 小時 (低解析度) - 2.5 Flash: 1 小時 **典型用法**: 短影片內容理解、教學影片提取知識點、監控錄影事件檢測、廣告片分鏡拆解。
model | string | required | 支援影片的 Gemini 模型, 如 `gemini-2.5-pro` / `gemini-2.5-flash` |
messages | array | required | |
role | string | required | |
content | array | ||
type | string | ||
text | string | ||
video_url | object | ||
url | string | required | 影片 URL |
fps | integer | (可選) 分析幀率, 預設 1 FPS | |
temperature | number | ||
max_tokens | integer | ||
stream | boolean |
200 — Gemini 對影片的理解curl https://api.router.ai/v1/chat/completions \
-H "Authorization: Bearer sk-xxx" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-2.5-pro",
"messages": [
{
"role": "user",
"content": [
{"type": "text", "text": "逐分钟拆解这个视频的关键事件"},
{"type": "video_url", "video_url": {"url": "https://example.com/demo.mp4"}}
]
}
]
}'