Three real levers cut vision spend: prompt caching, extract-once-then-reuse, and content-hash dedup. JPEG quality and higher resolution do not lower cost; they are distractors.
Pretend you have a friend who answers questions about a long picture book. Every time you ask, you mail them the whole book again, even though you both already saw it. The smart fix is to label the book so the post office only charges once, write a summary the first time so most questions can be answered from the summary, and notice when two people mail the same book so you only read it once. Squashing the photos smaller does not help because the post office charges by page count, not by how clearly the picture prints. Making the pictures sharper just makes the package heavier.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Vision cost optimisation is a recurring trap in production VLM workloads. The temptation is to reach for traditional 'make the file smaller' instincts (JPEG quality, dimensions) and assume that bytes-on-the-wire optimisations translate to inference cost. They do not. Provider billing for vision is entirely a function of pixel-derived tile counts and detail mode, with prompt caching and call elimination as the only real cost levers. Misreading this model wastes engineering effort on changes that do not move the bill while ignoring 5 to 10x discounts that are one config change away.
This walkthrough goes through the cost model, the three levers that actually work, and exactly why the two distractor options in the question do not.
Mental model: vision cost has three dimensions: tokens per call, calls per session, and price per token. The five options each claim to attack one of these; only three actually do.
The vision cost model
Every major provider in 2026 computes vision token cost from a combination of:
- Pixel dimensions of the input image. Specifically, how many fixed-size tiles (often 768 by 768) the image gets split into after provider-side resizing.
- Detail mode. Low maps the image to a small fixed token budget (~85 tokens for OpenAI, similar for others); high gives a per-tile token budget.
- Modality. Image tokens are typically priced the same as text tokens, but the cost density is much higher because each tile is hundreds of tokens.
None of these are functions of file size. JPEG quality, PNG compression level, transport encoding, base64 overhead: all invariant for billing purposes. They affect bandwidth and latency to the provider's edge, not the inference cost.
This is the key insight that eliminates two of the five options.
For a 1024 by 1024 image at high detail, you might pay around 765 input tokens regardless of whether the JPEG is 200 KB or 2 MB. Compressing the JPEG harder makes the upload faster (real, but a small effect) and degrades OCR accuracy (real, larger negative effect). It does not move the cost line in your bill.
Situations where this technique stops working.
2–4 min · Everything important, quickly.
Real products, models, and research that use this idea.
- Anthropic Claude Opus 4.7 and Sonnet 4.6 expose prompt caching with 5-minute and 1-hour TTL options; image prefixes qualify for cached pricing.
- OpenAI GPT-5.5 cached prefix pricing applies to image-containing prompts that share a stable prefix across requests.
What an interviewer would ask next. Try answering before peeking at the approach.
QHow do you decide whether a question can be answered from the cached extraction or needs a fresh vision call?
Router prompt over the stored extraction first; if the answer requires reading something not in the extraction (chart values, layout details), escalate to the vision model with that specific image.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Confusing JPEG file size with vision token cost. Providers bill by pixel-derived tiles; compression and bit-rate are transport optimisations that do not move the inference bill.
60 second bullets to scan on the way to the call.
How vision token cost is computed (pixel area, tile count, detail mode)
Provider prompt caching mechanics and TTLs
Primary sources. Browse if you want the original framing.
Same topic, related formats. Practice these next.