Send a video clip to a model that can watch it, and get text back.
Models that take video can watch a clip and answer about it — summarise it, describe a scene, find a moment. Send the clip as a video_url content part, beside your text, on /v1/chat/completions.
curl https://opendunes.com/v1/chat/completions \
-H "Authorization: Bearer $OPENDUNES_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "google/gemini-3.8-flash",
"messages": [
{
"role": "user",
"content": [
{ "type": "text", "text": "Describe what happens in this video, scene by scene." },
{ "type": "video_url", "video_url": { "url": "https://www.youtube.com/watch?v=…" } }
]
}
]
}'url is an address, or a base64 data URL for a local or private clip:
{ "type": "video_url", "video_url": { "url": "data:video/mp4;base64,AAAAIGZ0eXBpc29t…" } }| Format | |
|---|---|
video/mp4 · video/mpeg · video/mov · video/webm | taken |
Whether an address works depends on the provider: some take only YouTube links, some take no address at all and need the data URL. When an address fails, send the clip as base64.
On /v1/responses the part is input_video. /v1/messages takes no video.
A model takes video when its architecture.input_modalities on GET /v1/models includes video.
Google's Gemini models read an optional processing field on the video part: agentic lets the model move through the video and load only what it needs — for long videos, or a question about one moment; static samples the video at a fixed rate in one pass — for short clips, faster. Without it, the model's default applies; other providers ignore it.
With agentic, the model's navigation comes back as encrypted reasoning_details on the message. Send the message back with them intact on the next turn to keep the video in the conversation.
A video is read as prompt tokens, billed in DA at the model's input price, like text. A longer or sharper clip is more tokens: trim it to the part that matters, and lower its resolution where detail does not.