DeepSeek Vision API: The $0.22/M-Token Vision Model That Uses 10x Less KV Cache
DeepSeek quietly added eyes to its cheapest model line. deepseek-v4-flash-vision-exp — the experimental multimodal version of V4-Flash — accepts images, screenshots, charts, and video frames at V4-Flash prices: $0.22 per million input tokens, with every image capped at 384 tokens no matter how big it is.
The architecture makes it even more interesting: a custom vision transformer that squeezes a 756×756 image into just 81 KV cache entries — roughly 10x fewer than Claude Sonnet 4.6 (~870) or Gemini Flash 3 (~1,000). At scale, that’s a 10x infrastructure cost difference before you even look at the price list.
This guide covers the API end to end: the three ways to send images, pricing and limits, the visual primitives trick, and an honest comparison against the competition.
The model
| deepseek-v4-flash-vision-exp | |
|---|---|
| Base | DeepSeek-V4-Flash (284B total / 13B active, MoE) |
| Context / Output | 1M tokens / 384K max |
| Input price | $0.22/M (off-peak, cache miss) · $0.007/M cache hit |
| Output price | $0.66/M (off-peak) |
| Peak hours | 01:00-04:00 & 06:00-10:00 UTC (2x off-peak) |
| Concurrency | 2,500 |
| Formats | JPEG, PNG, GIF, WebP (from content, not filename) |
| Also available via | Anthropic-compatible /anthropic endpoint |
Three ways to send images
All use the standard OpenAI Chat Completions format — content is an array of blocks:
1. Base64 inline — simplest for local files:
import base64
from openai import OpenAI
client = OpenAI(api_key="<key>", base_url="https://api.deepseek.com")
b64 = base64.b64encode(open("image.jpg", "rb").read()).decode("utf-8")
response = client.chat.completions.create(
model="deepseek-v4-flash-vision-exp",
messages=[{"role": "user", "content": [
{"type": "text", "text": "What is in this image?"},
{"type": "image_url", "image_url": {"url": f"data:image/jpeg;base64,{b64}"}},
]}],
)
print(response.choices[0].message.content)
2. External URL — pass a public link (max 8192 chars, 32 MiB, 60s download):
{"type": "image_url", "image_url": {"url": "https://example.com/image.jpg"}}
3. Files API — upload once, reuse by file_id (up to 64 MiB, best for repeated use):
{"type": "file", "file_id": "file-api-xxxxxxxxxxxxxxxx"}
Optional detail field: low (downscaled to 512×512, cheaper/faster), high/original/auto (keeps original).
The pricing trick: 384 tokens, no matter what
Every image is auto-resized to roughly 800×800 equivalent before inference (small images upscaled, large downscaled, aspect ratio preserved). The result:
A 2000×2000 image and a 5000×5000 image cost exactly the same: 384 tokens.
At $0.22/M input, that’s $0.00008 per image (off-peak) before text. At ~90 tokens per typical image, a full vision request often costs fractions of a cent.
Why it’s 10x more efficient: the compression pipeline
The custom DeepSeek Vision Transformer compresses images before they ever hit the KV cache:
| Stage | 756×756 image |
|---|---|
| Patchification (14×14) | 2,916 patch tokens |
| 3×3 spatial compression | 324 tokens |
| Compressed sparse attention | 81 KV entries |
That’s a ~7,000x pixel-to-cache compression ratio. The practical comparison:
| Model | KV entries (80×80 image) |
|---|---|
| DeepSeek Vision | ~90 |
| Claude Sonnet 4.6 | ~870 |
| Gemini Flash 3 | ~1,000 |
For document pipelines, visual inspection, or video monitoring at scale, that’s a 10x infrastructure cost difference — before per-token pricing.
Visual primitives: the model points at things
DeepSeek’s secret weapon: the model can emit inline coordinate tokens in its chain of thought:
<ref>dog</ref><box>x1,y1,x2,y2</box>
Not function calling. Not a separate tool. The model literally points at objects as it reasons — like a human tracing with a finger. This is where it beats the big names:
| Task (maze navigation) | Score |
|---|---|
| DeepSeek Vision | 67% |
| GPT-5.4 | 50% |
| Gemini Flash 3 | 49% |
| Claude Sonnet 4.6 | 49% |
Honest limits (from DeepSeek’s own paper): resolution-bound on fine detail, primitives must be explicitly triggered (no auto-detection), point-based reasoning doesn’t generalize universally yet, and Gemini Flash 3 still leads raw counting QA.
Real-world economics
- $3 — one developer’s entire day of coding workflows on V4 pay-as-you-go
- $0.17 — an autonomous agent building a full Python CLI package: 136 API requests, 12.6M tokens, 142-test suite
- 10-100x cheaper — enterprise vision workflows (invoice extraction, screenshot-to-data, manufacturing QC) vs Claude/GPT-4o equivalents
Caveats
- Images only in user messages — system/assistant images return 400
- Only vision models accept images — other models return 400
- Data residency — the hosted API runs from China; enterprises with strict compliance can self-host the open weights (the release valve that converts a procurement blocker into an infrastructure decision)
Conclusion
DeepSeek Vision isn’t just cheap — it’s architecturally cheap. The MoE backbone, the 7,000x visual compression, the 384-token cap, and visual primitives all point the same direction: the cheapest representation that still works.
For cost-sensitive, scale-heavy vision workloads — invoices, screenshots, QC, document pipelines — it’s currently the most disruptive option on the market. For fine-grained visual QA, Gemini still holds the crown. Pick accordingly. 👁️
無程式碼也能輕鬆打造專業LINE官方帳號!一鍵導入模板,讓AI助你行銷加分!