AI

DeepSeek Vision API: The $0.22/M-Token Vision Model That Uses 10x Less KV Cache

DeepSeek's deepseek-v4-flash-vision-exp brings vision to the V4-Flash line: a 284B-parameter MoE model (13B active) that bills images at just $0.22 per million input tokens, caps every image at 384 tokens regardless of resolution, and compresses images into ~90 KV cache entries — 10x fewer than Claude and Gemini. Complete guide: sending images three ways, pricing, limits, the visual primitives trick, and how it compares to GPT-4o, Claude, and Gemini.

Keeping this site alive takes effort — your support means everything.
無程式碼也能輕鬆打造專業LINE官方帳號!一鍵導入模板,讓AI助你行銷加分! 無程式碼也能輕鬆打造專業LINE官方帳號!一鍵導入模板,讓AI助你行銷加分!
DeepSeek Vision API: The $0.22/M-Token Vision Model That Uses 10x Less KV Cache

Key takeaways

  • deepseek-v4-flash-vision-exp is DeepSeek's experimental multimodal model: 284B total parameters (13B active, MoE), 1M token context, 384K max output. It matches V4-Flash on text and leaps forward on multimodal agent benchmarks — approaching Anthropic Opus 4.8 — at V4-Flash pricing: $0.22/M input (cache miss, off-peak), $0.007/M (cache hit), $0.66/M output.
  • Three ways to send images: base64 inline (data: URL, counts toward 48 MiB body), external URL (max 8192 chars, 32 MiB, 60s download), or Files API file_id (up to 64 MiB, best for reuse). Formats: JPEG, PNG, GIF, WebP — detected from content, not filename. Images only in user messages; other models reject them with a 400.
  • Billing is brutally cheap: every image is resized to ~800x800-equivalent and capped at 384 tokens — a 2000x2000 and a 5000x5000 image cost the same. The custom DeepSeek Vision Transformer compresses 756x756 into just 81 KV cache entries via patchification (2,916) → spatial compression (324) → sparse attention (81): ~7,000x pixel-to-cache compression, ~10x fewer KV entries than Claude Sonnet 4.6 (~870) and Gemini Flash 3 (~1,000).
  • Visual primitives: the model outputs inline coordinate tokens like labelx1,y1,x2,y2 in its chain of thought — it literally points at objects as it reasons. On maze navigation it scores 67% vs GPT-5.4 (50%), Gemini Flash 3 (49%), Claude Sonnet 4.6 (49%). Honest limits: resolution-bound on fine detail, Gemini still leads raw count QA, and primitives must be explicitly triggered.
  • Real-world economics: developers report $3/day of coding on V4, and a $0.17 autonomous agent run (136 requests, 12.6M tokens). Enterprise vision workflows (invoices, screenshots, QC) cost 10-100x less than Claude/GPT-4o equivalents. Caveats: hosted API runs from China (data residency), so enterprises may self-host the open weights.

Key answers

What is the DeepSeek vision model?

deepseek-v4-flash-vision-exp is an experimental multimodal model on the DeepSeek API (base_url https://api.deepseek.com). It's built on the DeepSeek-V4-Flash architecture: 284B total parameters with 13B active (Mixture of Experts), 1M context window, 384K max output. It accepts images alongside text — JPEG, PNG, GIF, WebP — and matches V4-Flash on text capabilities while making a major leap on multimodal agent benchmarks, approaching Anthropic Opus 4.8. It's also available via the Anthropic-compatible endpoint (/anthropic).

How do I send an image to DeepSeek Vision?

Three ways, all OpenAI-compatible: (1) base64 inline — encode the image as a data: URL in an image_url block (counts toward the 48 MiB request body); (2) external URL — pass a public https link (max 8192 chars, image max 32 MiB, download must finish in 60s); (3) Files API — upload once with the Files API and reference file_id (up to 64 MiB, best for reuse or oversized images). You can also use file_data for inline base64 in a file block. The Anthropic endpoint uses image blocks with source.type base64/url/file.

How much does DeepSeek vision cost?

Same as V4-Flash: $0.22 per 1M input tokens (cache miss, off-peak; $0.44 peak), $0.007/$0.014 per 1M on cache hit, $0.66/$1.32 per 1M output. Images are billed as input tokens with a hard cap of 384 tokens per image — regardless of resolution (a 2000x2000 and 5000x5000 image cost identical). Off-peak hours are all times except 01:00-04:00 and 06:00-10:00 UTC. At ~90 tokens per typical image, a full vision request often costs fractions of a cent.

What are the image limits?

JPEG/PNG/GIF/WebP only (detected from content). External URLs max 8192 chars; request body max 48 MiB; max single image 32 MiB (inline/URL) or 64 MiB (Files API file_id); up to 600 images per request; max total image size 64 MiB without file_id or 200 MiB with; max dimension 8192 px per side (drops to 4096 px when 15+ images). Images are only accepted in user messages — system/assistant images return 400, and only vision models accept them.

What are 'visual primitives' in DeepSeek Vision?

A technique where the model outputs special coordinate tokens inline in its chain-of-thought, e.g. labelx1,y1,x2,y2. This lets the model literally point to objects as it reasons — like a human tracing objects with a finger — which dramatically improves topological/spatial tasks. On maze navigation DeepSeek scores 67% vs GPT-5.4 (50%), Gemini Flash 3 (49%), Claude Sonnet 4.6 (49%). Caveats: primitives must be explicitly triggered, resolution-bound on fine detail, and Gemini still leads raw counting QA.

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
BaseDeepSeek-V4-Flash (284B total / 13B active, MoE)
Context / Output1M 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 hours01:00-04:00 & 06:00-10:00 UTC (2x off-peak)
Concurrency2,500
FormatsJPEG, PNG, GIF, WebP (from content, not filename)
Also available viaAnthropic-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:

Stage756×756 image
Patchification (14×14)2,916 patch tokens
3×3 spatial compression324 tokens
Compressed sparse attention81 KV entries

That’s a ~7,000x pixel-to-cache compression ratio. The practical comparison:

ModelKV 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 Vision67%
GPT-5.450%
Gemini Flash 349%
Claude Sonnet 4.649%

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. 👁️