Video Inputs
Send a video as a video_url part in a chat message. The url can be a link or a base64 data URL. Use it to summarise videos, find objects and actions, describe scenes or review footage.
The samples use the OpenAI SDK set up as in the Quickstart.
From a URL
Which links work depends on the model’s host. Some take only YouTube links, some take none. If a link doesn’t work, send the video as base64.
From a local file
Python
Formats
video/mp4video/mpegvideo/movvideo/webm
Tips
- Keep files small. Compress, cut to the part you need, and lower the resolution: 720p is enough for most analysis, 480p for basic scene understanding.
- Split long videos. Each model has a maximum length; send long footage in parts and focus on the moments that matter.
- Ask a specific question about what to look for.
Troubleshooting
- Refused with
400: the model doesn’t take video. Pick a model that does. - The link is ignored or fails: the host doesn’t accept that kind of link. Send base64 instead.
- Request too large: compress the video, lower its resolution or frame rate, or cut it shorter.
Billing
The model turns the video into input tokens by its length and resolution, at its input price. Video takes many tokens per second, so check usage.prompt_tokens on a short clip first. A model that doesn’t take video refuses the request with a 400 before anything is held.