Skip to main content
Vision-capable models take images alongside text in a single request. You can hand the model a picture and ask it to describe the scene, read text from it (OCR), make sense of a UI screenshot, a diagram or a chart, or pull data out of a photographed table. Requests go to the same address as a normal chat: https://www.ruapi.ai/v1/chat/completions. The only thing that changes is the content field: instead of a string you pass an array of parts — text blocks {"type": "text"} and image blocks {"type": "image_url"}.
Use a model that supports vision: Claude (Sonnet / Opus), GPT, Gemini and GLM (GLM-5V-Turbo) accept images. DeepSeek is text-only — see DeepSeek models.

Image from a public URL

The simplest case — the image is already online at a direct URL.
Python (OpenAI SDK)
The link must open directly, without signing in: the image is downloaded while the request is processed. If the download fails (the link has expired, the file was deleted), the request usually fails with a 400 error and error.message explains why. Check the link or send the image as base64, as shown below.

Local file via base64

If the image isn’t publicly reachable (a screenshot, a photo on disk), encode it to base64 and pass it as a data URI in the form data:image/jpeg;base64,....
Python (OpenAI SDK)
For PNG change the prefix to data:image/png;base64,, for WebP use data:image/webp;base64,. The MIME type must match the file’s real format.

Gotchas

An image counts as input tokens, and the higher the resolution the more expensive the request. If you don’t need the fine detail, downscale the image before sending (for example to 1024–1568 px on the long side).
A base64 string is about a third larger than the file itself and travels entirely inside the request body. For heavy images a public URL is safer than a multi-megabyte data URI — otherwise you can hit the request size limit.
Typically jpeg, png, webp and gif. Convert exotic formats (HEIC, TIFF, SVG) to one of these beforehand.

What’s next