- The universal format is the OpenAI-compatible
image_url:{"type": "image_url", "image_url": {"url": "data:image/png;base64,..."}}worked on all 22 vision models we tested. The Responses and Anthropic formats only reach some models — see “Which models each format supports”. - Text-only models such as
deepseek-v4-proandglm-5.3do not accept images: the request still returns 200, but the image is dropped and the model just says it cannot see one. To check whether the image reached the model, look atusage.prompt_tokensin the response. - Prefer Base64: with a public URL the provider has to download the image, which fails if the host is slow, uses hotlink protection, or omits the
Content-Lengthheader (Qwen returns 400 in that case).
Image Recognition · APIYI Online Tool
Video Understanding API
Let an AI Agent Do the Integration
Copy this prompt and paste it into Codex / Claude Code / Cursor
It first fetches the plain-text version of this page (append .md to any docs URL), then writes code in your project's own stack — the universal image_url format, downscaling large images first, and checking prompt_tokens to confirm the image actually reached the model are already baked into the requirements.
Integrate / troubleshoot vision understanding in this project: send images to a multimodal model for OCR, counting, scene description or multi-image comparison.
Read the docs before you touch code: fetch https://docs.apiyi.com/en/api-capabilities/vision-understanding.md for the plain-text version of this page.
- Endpoint and format: by default use the OpenAI-compatible
POST https://api.apiyi.com/v1/chat/completionsand pass each image as …
9 requirements in total. Use the button below to copy the full prompt.
What this prompt protects you from
What this prompt protects you from
Supported models
These results come from tests run on 2026-10-11 (UTC+8): every model had to transcribe the same 1200×760 mixed Chinese/English order image (including a table) word for word, count shapes, spot the difference between two images and read public image URLs. A blank image was used as a control to rule out answers produced without looking.gemini-3.1-flash-lite and gpt-5.4-mini can also read images and got the OCR fully right, but they miscount objects (correct in 0 of 3 and 1 of 3 runs respectively), so avoid them for counting tasks. qwen-vl-ocr is a dedicated OCR model that outputs only tables and skips all text outside them, and in multi-image requests it only reads the first image — use it only for pure table / ID-document scenarios.
Models that do not accept images
Which models each format supports
Quick start: the universal format (image_url)
Local image (Base64, recommended)
Public image URL
Comparing several images
Add oneimage_url block per image, in order, and refer to them as “image 1” and “image 2” in the prompt:
curl
Other formats
OpenAI Responses (input_image)
For projects already on the OpenAI Responses SDK. It only reaches GPT, Grok, Qwen3.8, Kimi, MiniMax and DeepSeek Vision — Gemini / Claude / Seed return 400.
Anthropic Messages (image)
For the Claude ecosystem (the Anthropic SDK, Claude Code and so on), endpoint https://api.apiyi.com. The base64 source reaches Claude, Gemini, GPT, Qwen, Kimi and MiniMax; the url source only works on Claude (Gemini silently drops the image).
Gemini native format (inline_data)
If your project already uses Google’s official google-genai SDK, just point base_url at https://api.apiyi.com:
POST https://api.apiyi.com/v1beta/models/gemini-3.8-flash:generateContent with the header x-goog-api-key: YOUR_API_KEY, and the image inside contents[].parts[] as {"inline_data": {"mime_type": "image/png", "data": "<BASE64>"}}. For more native usage see Gemini native format.
Downscale large images first
Providers handle large images very differently. Results for one 9000×6000 JPEG of about 10 MB:Common errors
Image URL download timeout
If you get this error when passing an image URL:Missing Content-Length of multimodal url (Qwen)
Qwen models require the image host to send aContent-Length response header. Some CDNs (Cloudflare, for example) serve images with chunked transfer and no such header, which triggers this error; serve the same image from object storage or send it as Base64 instead.
invalid base64 data (a URL placed in the Base64 field)
If you get a 400 error like this (the key phrase isinvalid base64 data; wording varies slightly by model):
data:image/...;base64, prefix must be the Base64 encoding of the image file itself. The URL form and the Base64 form are mutually exclusive and cannot be mixed:
Declared image type does not match the actual format (media type mismatch)
If you get a 400 error like this (the key phrase isThe image was specified using the image/png media type, but the image appears to be a image/jpeg image):
data:image/png;base64,...), but the provider decoded it, checked the file header and found the actual content is JPEG, so it rejected the request. Common causes: inferring the format from a file extension that was changed, or hard-coding image/png in code.
Advanced tips
Confirm the image actually reached the model
Checkusage.prompt_tokens in the response: a 1200×760 image costs roughly 900–1,300 tokens on most providers (about 570 on DeepSeek Vision); if the count barely grows over a text-only request, or does not grow at all, the image was dropped. This happens on text-only models (deepseek-v4-pro, glm-5.3), on Grok via the Anthropic endpoint, and on Gemini via the Anthropic url source.
The detail parameter
detail: "low" inside image_url is honored only by some models: gpt-5.4-mini (1,147 → 233 tokens, but small text starts being misread) and Seed (1,340 → 602 tokens, OCR still fully correct); GPT-6 / 5.6, Gemini, Claude and Qwen ignore it. A more portable way to save tokens is to downscale the image yourself.
Parameters
On the chat endpoint,max_tokens and temperature work normally on GPT (including GPT-6), Claude and Gemini (temperature=0.3 passed on all of them in our tests). MiniMax-M3 puts its <think>...</think> reasoning in the content, so strip it yourself.
Prompt ideas for common tasks
The same image can drive very different tasks just by changing the prompt — no code changes required:- OCR: “Transcribe all text in the image word for word, and output tables as Markdown tables”
- Counting / structured output: “Count how many of each object there are and output only JSON:
{"object": count}” - Product analysis: “Identify the product type and brand, and list its main selling points and target audience”
- Multi-image comparison: “Below are image 1 and image 2 — list every difference”
- Chart reading: “Read the axes, the data trend and the maximum and minimum values”
FAQ
Which models can read images?
Which models can read images?
deepseek-v4-pro and glm-5.3 cannot. For other models, check the “Input modalities” row on the model detail page.I sent an image but the model says it cannot see one?
I sent an image but the model says it cannot see one?
usage.prompt_tokens in the response first: a few dozen tokens means the image never reached the model. Common causes: ① you picked a text-only model; ② you called Grok through the Anthropic endpoint, or Gemini through the Anthropic url source (both silently drop the image); ③ the provider could not download the public URL. Switching to chat image_url with Base64 solves almost all of these.The same code returns 400 as soon as I switch models?
The same code returns 400 as soon as I switch models?
image_url format and it works across providers.Claude returned 429 — am I being rate limited?
Claude returned 429 — am I being rate limited?
image exceeds 10 MB maximum, the image is too large (measured after Base64 encoding); retrying will not help — resize the long side to about 2048 px and send it again.GPT vision keeps timing out, or returns 429 / 400 patches over the limit?
GPT vision keeps timing out, or returns 429 / 400 patches over the limit?
patches ... exceeding the limit right away. Retrying will not help; downscale the long side to 2048 px and resend. Test results and how to diagnose: Image Understanding Requests Keep Timing Out — Is the Image Too Large?.Why did one image cost tens of thousands of tokens?
Why did one image cost tens of thousands of tokens?
gpt-6-sol in our tests. After resizing the long side to about 2048 px, the same image dropped to 3,320 tokens on gpt-6-sol and roughly 700–3,700 tokens across providers.Which image formats are supported?
Which image formats are supported?