How to Use DeepSeek V4 Flash (82.7 Terminal-Bench at $0.14/$0.28 per 1M)

Read time: ~7 minutes. TL;DR — point any OpenAI client at it:

from openai import OpenAI
client = OpenAI(api_key="YOUR_DEEPSEEK_KEY", base_url="https://api.deepseek.com")
r = client.chat.completions.create(model="deepseek-v4-flash",
        messages=[{"role":"user","content":"Refactor this function."}])

Anthropic-format clients use https://api.deepseek.com/anthropic instead.

Key facts:

  • Official public beta July 31, 2026. Model id: deepseek-v4-flash (version DeepSeek-V4-Flash-0731).
  • Terminal Bench 2.1: 82.7 — plus DeepSWE 54.4, NL2Repo 54.2, Cybergym 76.7, Toolathlon 70.3.
  • $0.14 / 1M input (cache miss), $0.28 / 1M output — and $0.0028 on a cache hit (~50× cheaper).
  • 1M context, 384K max output, thinking mode on by default.
  • Responses API support is Flash-only (V4-Pro gets it early August); Flash is specifically adapted for Codex.
  • ⚠️ Peak-hour pricing is coming: 2× during 09:00–12:00 and 14:00–18:00 Beijing time.

Sourcing note: every number, model id, URL, and feature flag below is quoted from DeepSeek’s official API change log and Models & Pricing page, fetched August 2, 2026. Benchmarks are DeepSeek’s own reported results. Links at the bottom.

DeepSeek quietly shipped the thing that matters most to builders: a cheap model with real agent benchmarks. V4 Flash’s official release posts Terminal Bench 2.1 at 82.7 — higher than GLM-5.2’s 81.0 — at $0.14 in / $0.28 out per 1M tokens. Here’s how to use it and where the pricing traps are.


1. What shipped on July 31

From the official change log:

The official release of the DeepSeek-V4-Flash API is now in public beta. The API calling method remains unchanged — simply set the model name to deepseek-v4-flash to use the latest version.

Three things worth knowing:

  • Same architecture, new post-training. DeepSeek-V4-Flash-0731 “keeps the same model architecture and size as DeepSeek-V4-Flash-Preview, and was only re-post-trained.” The gains are from post-training, not a bigger model.
  • Agent capabilities are the headline. DeepSeek says benchmark results now “far exceed V4-Pro-Preview” — i.e. the cheap model beats the expensive one on agentic tasks.
  • This update touches only the V4-Flash API. The V4-Pro API and the APP/WEB models are unchanged; official V4-Pro “will follow soon.”

2. The benchmarks

DeepSeek’s own reported results for the official V4-Flash:

BenchmarkScore
Terminal Bench 2.182.7
Cybergym76.7
Toolathlon (verified)70.3
DSBench-FullStack*68.7
DSBench-Hard*59.6
DeepSWE54.4
NL2Repo54.2
Agent Last Exam25.2
Automation Bench (Public)25.1

* internal test sets (full-stack development / Coding Agent hard problems).

Read the test conditions before you compare. DeepSeek states these Code Agent results were measured using DeepSeek Harness minimal mode (not yet released) as the framework, at max effort level, top_p = 0.95, temperature = 1.0. A different harness will give different numbers — that’s true of every agent benchmark, and it’s why 82.7 shouldn’t be read as strictly comparable to another lab’s Terminal-Bench figure.

Still, for context: we covered GLM-5.2 at 81.0 on Terminal-Bench 2.1, a 744B open-weight model. Flash reaching this tier as a cheap hosted API is the story.


3. Pricing — and the two things that change your bill

Official per-1M-token pricing:

deepseek-v4-flashdeepseek-v4-pro
Input (cache hit)$0.0028$0.003625
Input (cache miss)$0.14$0.435
Output$0.28$0.87
Concurrency limit2500500
Responses API✗ (early Aug)

Trap 1 — the cache-hit discount is enormous. $0.0028 vs $0.14 is a ~50× difference on input. If you run an agent with a stable system prompt and growing context, structuring requests so the prefix stays byte-identical is the single biggest cost lever here — far bigger than choosing between models. (Same principle we walk through for Claude Code’s cached prefix.)

Trap 2 — peak-hour pricing is coming. Straight from the pricing page:

The DeepSeek API service will soon adopt a peak/off-peak pricing policy. During peak hours, prices will be 2× the regular prices, applicable to all billing items. Peak hours: 09:00–12:00 and 14:00–18:00 (Beijing Time, UTC+8) daily.

The effective date is “subject to the official announcement” — so it isn’t live yet, but batch jobs and CI scans should be scheduled outside those windows once it lands. That’s 7 hours a day at double price.

Also note Flash’s concurrency limit is 2500 vs Pro’s 500 — Flash is the one built for volume.


4. Calling it: three interfaces

OpenAI format (most common):

from openai import OpenAI

client = OpenAI(
    api_key="YOUR_DEEPSEEK_KEY",
    base_url="https://api.deepseek.com",
)

resp = client.chat.completions.create(
    model="deepseek-v4-flash",
    messages=[{"role": "user", "content": "Refactor this function and explain why."}],
)
print(resp.choices[0].message.content)

Anthropic format — point an Anthropic-SDK client at:

https://api.deepseek.com/anthropic

Responses API — supported on deepseek-v4-flash only. Per the docs, V4-Pro “does not yet support the Responses API. We will add support … in early August 2026.” If you’ve standardized on Responses-API-shaped code, Flash is currently your only DeepSeek option.

Codex users: the official V4-Flash “natively supports the Responses API format and is specifically adapted for Codex” — check DeepSeek’s docs for the exact config block before wiring it in.


5. Capabilities and limits

deepseek-v4-flash
Context1M
Max output384K
Thinking modeBoth non-thinking and thinking (default)
JSON output / Tool calls✓ / ✓
Chat Prefix Completion (beta)
FIM Completion (beta)Non-thinking mode only

Thinking is on by default — relevant to both latency and your output-token bill, since reasoning tokens are output tokens. If you’re doing high-volume classification or extraction where reasoning adds nothing, switch to non-thinking mode (see DeepSeek’s Thinking Mode docs) before you scale up.

Note also that FIM (fill-in-the-middle) completion works only in non-thinking mode — worth knowing if you’re building autocomplete.


6. Flash or Pro?

  • Use Flash for essentially everything right now: it’s ~3× cheaper, has 5× the concurrency, reportedly beats V4-Pro-Preview on agent benchmarks, and is the only one with Responses API + Codex adaptation today.
  • Wait for official Pro if you specifically need Pro-tier behavior — DeepSeek says the official V4-Pro release “will follow soon,” and Pro’s Responses API support is slated for early August 2026.

The unusual situation: the cheap tier currently wins on price, throughput, agent scores, and API surface. Until official Pro lands, the choice is easy.

The takeaway

DeepSeek V4 Flash (official public beta, July 31, 2026) is the cheap-agent-model story of the moment: deepseek-v4-flash, Terminal Bench 2.1 82.7, 1M context / 384K output, at $0.14 in / $0.28 out per 1M — about 3× cheaper than V4-Pro with 5× the concurrency. Point an OpenAI client at https://api.deepseek.com (or an Anthropic one at /anthropic), and use the Responses API / Codex adaptation that only Flash has today. Then handle the two pricing realities: keep prompt prefixes stable to hit the ~50× cache-hit discount, and schedule batch work outside 09:00–12:00 / 14:00–18:00 Beijing time before the 2× peak pricing takes effect.

For the Pro tier see DeepSeek V4 Pro; for an open-weight model in the same Terminal-Bench range, GLM-5.2 locally.

Sources

  • DeepSeek API Change Log — 2026-07-31 DeepSeek-V4-Flash Update: official public beta, model name deepseek-v4-flash, benchmarks (Terminal Bench 2.1 82.7, NL2Repo 54.2, Cybergym 76.7, DeepSWE 54.4, Toolathlon verified 70.3, Agent Last Exam 25.2, Automation Bench Public 25.1, DSBench-FullStack 68.7, DSBench-Hard 59.6), test conditions (DeepSeek Harness minimal mode, max effort, top_p 0.95, temperature 1.0), native Responses API support and Codex adaptation, V4-Flash-0731 same architecture/size as Preview with re-post-training only, V4-Pro API and APP/WEB unchanged
  • DeepSeek Models & Pricing — base URLs (OpenAI https://api.deepseek.com, Anthropic https://api.deepseek.com/anthropic), 1M context / 384K max output, thinking mode default, feature matrix (JSON output, tool calls, Responses API Flash-only, Chat Prefix Completion beta, FIM non-thinking only), pricing ($0.0028 cache-hit / $0.14 cache-miss input, $0.28 output for Flash; $0.003625 / $0.435 / $0.87 for Pro), concurrency limits (2500 vs 500), upcoming 2× peak pricing for 09:00–12:00 and 14:00–18:00 Beijing time, Responses API for V4-Pro slated early August 2026
  • Benchmarks are DeepSeek’s own reported results under their stated harness and settings — not directly comparable across labs. Peak pricing was not yet in effect as of publication (“subject to the official announcement”). Verified August 2, 2026.