POST
Chat(分析视频)
POST /v1/chat/completions — 视频内容分析
Chat(分析视频)
通过 Chat Completions API 传入视频 URL,分析视频内容。所有对话模型均可使用此接口,修改 model 参数即可。
注意: 需要模型支持视频读取能力。目前主要支持 Gemini 系列模型(如
gemini-2.5-pro-preview)。
POST
https://api000.com/v1/chat/completions
请求示例
{
"model": "gemini-2.5-pro-preview-05-06",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "请分析这段视频的主要内容"
},
{
"type": "image_url",
"image_url": {
"url": "https://example.com/video.mp4"
}
}
]
}
]
}
from openai import OpenAI
client = OpenAI(base_url="https://api000.com/v1", api_key="sk-xxxxxxxxxxxxxxxx")
response = client.chat.completions.create(
model="gemini-2.5-pro-preview-05-06",
messages=[
{
"role": "user",
"content": [
{"type": "text", "text": "请描述这个视频的主要内容"},
{
"type": "image_url",
"image_url": {"url": "https://example.com/sample.mp4"}
}
]
}
]
)
print(response.choices[0].message.content)
注意事项
- 视频 URL 必须是公网可访问的直链地址
- 支持
.mp4、.mov、.avi等常见视频格式 - 视频时长和大小限制取决于具体模型
- 目前仅 Gemini 系列模型支持视频分析