DeepSeek V4 Flash API 2026: Agent King at One-Third the Cost
On 2026-07-31, DeepSeek pushed the official release of DeepSeek-V4-Flash-0731 — a fast, agent-optimized LLM that tops the company's own agent benchmarks while costing one-third of V4-Pro. Same 1M context, 384K max output, native Anthropic API support, and the only DeepSeek model that natively drives OpenAI Codex through the Responses API. The migration is one line of code: set model="deepseek-v4-flash" and stop paying Pro prices for Pro performance you don't need.
What Changed from Preview to Official
The architecture, parameter count, and context window are identical to DeepSeek-V4-Flash-Preview. The official release is a fresh post-training run that lifts every published agent benchmark above V4-Pro-Preview:
| Benchmark | V4-Flash-0731 | What it measures |
|---|---|---|
| Terminal Bench 2.1 | 82.7 | End-to-end agent tasks inside a real shell |
| NL2Repo | 54.2 | Natural-language-to-codebase synthesis |
| Cybergym | 76.7 | Offensive cybersecurity agent tasks |
| DeepSWE | 54.4 | Real-bug fixes in SWE-Bench-style repos |
| Toolathlon | 70.3 | Multi-tool selection and recovery |
| Agent Last Exam | 25.2 | Hardest open-ended agent reasoning |
Note 1: the official benchmark numbers are measured using DeepSeek's own DeepSeek Harness minimal mode (forthcoming) with the max effort preset, top_p=0.95, temperature=1.0. If you run V4-Flash locally with different scaffolding you may see slightly lower numbers — the harness, not the model, is the dominant variable on agent evals.
Pricing: One-Third of V4-Pro, 5x the Concurrency
DeepSeek kept the V4 line's three-tier token pricing (cache hit, cache miss, output). V4-Flash slots in as the budget tier that still beats Pro on agent workloads:
| Per 1M tokens | V4-Flash | V4-Pro | Flash / Pro |
|---|---|---|---|
| Input (cache hit) | $0.0028 | $0.003625 | ~77% |
| Input (cache miss) | $0.14 | $0.435 | ~32% |
| Output | $0.28 | $0.87 | ~32% |
| Concurrency limit | 2,500 | 500 | 5.0x |
| Context length | 1M | 1M | same |
| Max output | 384K | 384K | same |
Note 2: DeepSeek has warned that a peak/off-peak pricing policy is coming. During peak hours, all billing items will be 2x the rates above. The effective date will be announced separately — when that lands, this table is the floor, not the ceiling.
The headline story: for a typical agent workload with mostly cache misses (cold-prefix prompts) the per-request cost is roughly one-third of V4-Pro. Pair that with the 5x concurrency ceiling and V4-Flash is the first DeepSeek model where high-throughput agent fleets are economically sensible without a custom enterprise contract.
Three APIs, One Model: OpenAI, Anthropic, Responses
V4-Flash is the first DeepSeek model that is fully wired into all three of the API ecosystems the agent community standardizes on:
- OpenAI ChatCompletions —
https://api.deepseek.com, modeldeepseek-v4-flash. Drop-in replacement for any code that already callsgpt-4o-minioro4-mini. - Anthropic Messages API —
https://api.deepseek.com/anthropic. Lets Claude Code and Claude SDK code use DeepSeek with a one-line base URL change. Useful for teams that built against Anthropic's tool-use schema and don't want to port to OpenAI format. - Responses API — the format used by OpenAI Codex. V4-Pro does not support it yet; Flash is the only DeepSeek model that can drive Codex today. V4-Pro Responses API support is expected in early August 2026.
Native JSON output, tool calls, Chat Prefix Completion (Beta), and FIM Completion (Beta, non-thinking mode only) are all supported on V4-Flash. The thinking mode toggle follows the same {"thinking": {"type": "enabled"}} pattern as other DeepSeek models.
Native Codex Integration: One Script, Three Clients
DeepSeek ships a one-script installer that configures Codex CLI, ChatGPT desktop, and the VS Code Codex extension in one shot. macOS / Linux:
bash <(curl -fsSL https://cdn.deepseek.com/api-docs/codex-deepseek-setup.sh)
Windows PowerShell:
irm https://cdn.deepseek.com/api-docs/codex-deepseek-setup-en.ps1 | iex
The script writes ~/.codex/config.toml so the Codex IDE extension, Codex CLI, and ChatGPT desktop all share the same DeepSeek-backed config. If you prefer to wire it manually, the equivalent is to set:
# ~/.codex/config.toml
[model]
name = "deepseek-v4-flash"
[providers.deepseek]
base_url = "https://api.deepseek.com"
api_key = "${DEEPSEEK_API_KEY}"
Either path gives you Codex running on DeepSeek with Terminal Bench 2.1 at 82.7 — well above the Codex-default model's published numbers on comparable agent evals.
Thinking Mode and the V3.x Retirement Clock
V4-Flash supports both non-thinking and thinking modes. Default is thinking (the model emits chain-of-thought before the final answer). Switch with:
// OpenAI format
{ "thinking": { "type": "enabled" } } // or "disabled"
// Anthropic format
{ "thinking": { "type": "enabled" } } // extended-thinking variant
// Responses API format
{ "reasoning": { "effort": "high" } } // effort: low | medium | high | max
DeepSeek has also confirmed the retirement timeline for the V3.x model names:
- deepseek-chat and deepseek-reasoner will be retired 2026-10-24 (three months after the V4 announcement).
- Until then,
deepseek-chatcontinues to alias to V4-Flash non-thinking mode, anddeepseek-reasonerto V4-Flash thinking mode. - Code that targets V3.x model names is not broken today, but will hard-fail in October. The safe move is to migrate all references to
deepseek-v4-flashnow and pin the mode explicitly.
Migration: A 3-Line Diff from V3.x or Preview
Migrating an OpenAI-format integration from deepseek-chat or deepseek-reasoner to V4-Flash is a model-name swap. The base URL, the request body shape, and the streaming protocol are all unchanged:
// Before (V3.x)
const r = await fetch("https://api.deepseek.com/chat/completions", {
method: "POST",
headers: { Authorization: "Bearer " + DEEPSEEK_API_KEY,
"Content-Type": "application/json" },
body: JSON.stringify({
model: "deepseek-chat", // alias to V4-Flash non-thinking
messages: [{ role: "user", content: prompt }],
stream: false,
})
});
// After (V4-Flash official)
const r = await fetch("https://api.deepseek.com/chat/completions", {
method: "POST",
headers: { Authorization: "Bearer " + DEEPSEEK_API_KEY,
"Content-Type": "application/json" },
body: JSON.stringify({
model: "deepseek-v4-flash", // explicit, future-proof
messages: [{ role: "user", content: prompt }],
thinking: { type: "enabled" }, // explicit mode toggle
stream: false,
})
});
If you want to evaluate before committing, DeepSeek recommends a canary split: send 10% of production traffic to V4-Flash with the official mode toggle, keep 90% on your current model alias for 48 hours, compare token spend and task-completion rates, then flip the routing if Flash meets or beats the baseline.
V4-Flash vs V4-Pro vs Kimi K3 vs Claude Opus 4.7
How does V4-Flash stack up against the other open-weight or Anthropic-flavored options on the 2026 mid-tier? The pricing table below uses cache-miss input as the headline number because most agent traffic is cold-prefix:
| Model | $ / 1M in | $ / 1M out | Best for |
|---|---|---|---|
| DeepSeek V4-Flash | $0.14 | $0.28 | High-volume agent loops, Codex replacement |
| DeepSeek V4-Pro | $0.435 | $0.87 | Hardest agent reasoning, when Flash undershoots |
| Kimi K3 (open) | Self-host | Self-host | 1M context, on-prem or sovereign cloud |
| Claude Opus 4.7 (Anthropic API) | ~$15 | ~$75 | Frontier reasoning, when cost is secondary |
The 100x cost gap to Opus 4.7 is not a typo. For teams whose workloads hit Terminal Bench 2.1 above ~70 with V4-Flash, the Pro-tier Anthropic spend is rarely justifiable.
Current Limitations
- Peak/off-peak pricing is coming — 2x during peak hours. Pin your batch workloads off-peak if you can.
- Responses API is Flash-only for now — V4-Pro Responses support is scheduled for early August 2026. If your agent stack relies on Pro on Codex, you are temporarily locked to Flash.
- Codex one-script installer requires Codex already initialized — the setup script assumes
~/.codexexists. Run Codex CLI or ChatGPT desktop at least once before running the DeepSeek setup. - Reasoning effort is preset-locked — the Responses API format exposes
low | medium | high | max, but the OpenAI and Anthropic formats use a binaryenabled | disabledtoggle without fine-grained effort control. OpenAI/Anthropic-format agents that need reasoning-budget tuning must go through the Responses API. - Official benchmarks use forthcoming harness — the published Terminal Bench / NL2Repo scores assume the soon-to-release DeepSeek Harness minimal mode. Third-party harnesses will likely see a few points lower.
Verdict: Set Model = "deepseek-v4-flash" Today
V4-Flash is the rare release where the headline is literally the headline: it beats V4-Pro on every agent benchmark DeepSeek publishes, costs one-third as much, and supports 5x the concurrency. The fact that it is the only DeepSeek model wired into Codex today makes it the obvious default for any team running agents at scale — not because the open-weight frontier has collapsed, but because Flash is now the highest agent-benchmark-per-dollar option on the API market.
For most agent-heavy workloads today, the right call is: keep Pro for the hardest 5-10% of tasks (where the benchmark ceiling matters), default everything else to Flash. The October 2026 V3.x retirement makes the migration unavoidable anyway — you might as well land it now and pocket the cost reduction while the harness gap between Flash and Pro is at its narrowest.
Routing V4-Flash across providers? If you do not want to manage DeepSeek direct billing alongside OpenAI, Anthropic, and Google traffic, FreeModel exposes V4-Flash (and V4-Pro, Kimi K3, Claude Opus 4.7, GPT-5.6 Sol) through a single API key with usage dashboards that surface cost-per-task across models — handy when the Flash / Pro split above is not a static decision.