title: Vision Understanding (Multimodal: Image / Video)
Vision Understanding (Multimodal: Image / Video)
Image and video chat use the same endpoint as text chat, /v1/chat/completions: change content from a string to an array mixing text with images / video. For available models and prices see the Model Plaza (vision models usually have vl / vision / omni in the name); below we use qwen3-vl-flash.
How to Pass Media
Both images and videos support two ways of passing the media; the material type is set via type: image_url for images, video_url for videos (only some models support it):
So a multimodal message's content array looks like this:
- Public URL: simplest when the file is already online; prefer this
- Base64 data URL: for local files, read and encode as
data:<mime>;base64,<data>; the request body gets large, especially for video
Parameter Summary
Vision models differ in which parameters they accept. Summary below (✅ = universal, ⚠️ = only some models):
Vision model parameters are not standardized: for example doubao-seed-2-0-pro-260215, deepseek-v4-flash-vision-exp, and Kimi K3 differ in whether they accept video input and whether they have thinking / reasoning_effort parameters and which values they allow. Unsupported parameters may be ignored or rejected with an error. Which model accepts which parameters — check the Model Plaza model details and your own testing; just run the examples below against different model names to confirm.
Image Understanding Example
For Base64, just swap the url for a data URL:
Video Understanding Example
For video, switch type to video_url — everything else stays the same. Note that only some models accept video input: an error or silent ignore means the current model doesn't support it; switch to a video-capable model and retry:
Images and videos both consume a lot of input tokens (proportional to resolution / duration). In high-volume scenarios, keep media sizes down to save cost.
