DeepSeek V4-Flash-0731: Codex-compatible coding agents at $0.28 per million tokens (2026)

V4-Flash-0731 gives coding agents a 1M-context, Codex-compatible model at $0.14/$0.28 per million tokens. Setup, benchmarks and cost math.

Read time
13 min
Word count
2.1K
Sections
13
FAQs
8
Share
Editorial hero graphic for DeepSeek V4-Flash-0731 coding agents
DeepSeek V4-Flash-0731: a Codex-compatible coding model at $0.14/$0.28 per million tokens.
On this page · 13 sections
  1. What DeepSeek shipped on July 31
  2. Pricing: the numbers that change the decision
  3. How V4-Flash-0731 scores on agent benchmarks
  4. How to point a coding agent at V4-Flash
  5. Cost math for a real coding-agent workload
  6. Getting the cache to actually hit
  7. When to escalate to V4-Pro, and when not to
  8. India-specific considerations
  9. Migration and the retired aliases
  10. Limits and honest caveats
  11. FAQ
  12. How eCorpIT can help
  13. References

Summary. DeepSeek shipped V4-Flash-0731 on July 31, 2026, and for coding agents it resets the price floor: $0.14 per million input tokens, $0.28 per million output, and $0.0028 on a cache hit, with a 1 million token context and up to 384,000 output tokens (Hugging Face; CloudZero). The release is OpenAI-compatible, adds native Responses API support and an official OpenAI Codex configuration path, and ships under an MIT licence. On DeepSeek's own agent benchmarks it beats the larger V4-Pro Preview on all nine listed tests, scoring 82.7 on Terminal Bench 2.1. Against OpenAI's GPT-5.3-Codex, at about $1.75/$14 per million tokens in August 2026, that is roughly a 12x cheaper input and 50x cheaper output rate. This guide covers what changed, how to wire a coding agent to it, the cost math, and where V4-Pro or a self-hosted copy still makes sense.

If you run a coding agent, the model is now the cheap part of your stack. The expensive part is the context you feed it and the tokens it writes back on every step of an agent loop. That is exactly where V4-Flash-0731 lands: a frontier-class model priced for the high-volume, high-output workloads that break most API budgets.

What DeepSeek shipped on July 31

V4-Flash-0731 is the official release of DeepSeek-V4-Flash, replacing the earlier preview build. The Hugging Face model card describes it as sharing the structure of the V4-Flash-DSpark checkpoint, meaning it carries a DSpark speculative-decoding module that speeds up generation. DeepSeek lists it as a mixture-of-experts model that activates roughly 13 billion of its 284 billion parameters per token (per CloudZero's rate card); the published weights total 304 billion parameters on disk, including the speculative-decoding module.

Three changes matter for agent builders. First, the model gained a reasoning_effort parameter with three levels, low, high, and max, so you can dial deliberation up for a hard refactor and down for routine edits. Second, DeepSeek added native Responses API support and an official Codex configuration path, so the model drops into tooling built around OpenAI's interfaces (explainx; MarkTechPost). Third, the retrained checkpoint targets agentic behaviour directly, and AlphaSignal and TechTimes both reported it overtaking the larger V4-Pro Preview on DeepSeek's published agent suite.

The context and output limits are the same on both V4 tiers: a 1 million token context and a 384,000 token maximum output. DeepSeek recommends that 384K ceiling specifically for the high and max effort levels, which is where a long agent transcript or a full-repository read actually needs the room.

Pricing: the numbers that change the decision

The rate card is the reason this release is worth a migration. These figures are per million tokens, as listed by CloudZero (verified against DeepSeek's pricing page) and the OpenAI-pricing trackers, as of August 2, 2026. DeepSeek's V4-Pro promotional discount has been on and off through 2026, so confirm the current Pro rate before you budget.

Model Input ($/M) Output ($/M) Cache-hit input ($/M) Context
DeepSeek V4-Flash-0731 0.14 0.28 0.0028 1M
DeepSeek V4-Pro (75% promo) 0.435 0.87 0.003625 1M
DeepSeek V4-Pro (standard) 1.74 3.48 0.0145 1M
OpenAI GPT-5.6 Luna 0.20 1.20 prompt caching large
OpenAI GPT-5.3-Codex 1.75 14.00 prompt caching large
OpenAI GPT-5.6 Sol 5.00 30.00 prompt caching large

Two things stand out. V4-Flash output at $0.28 undercuts every OpenAI coding tier by a wide margin, and the output column is where agent workloads spend most of their money. And the cache-hit input rate of $0.0028 is a 98 percent discount on the standard input price, applied automatically to matching prompt prefixes (CloudZero). OpenAI's own price cut on July 30, 2026 brought its cheap Luna tier to $0.20/$1.20 (DevTk.AI; GLBGPT), which is close on input but still four times the output rate of V4-Flash and a smaller model.

DeepSeek's caching is worth designing around. It uses automatic disk-based prefix caching, so a request that starts with a matching system prompt, tool schema, or document preamble serves those tokens at one tenth of the standard rate with no code changes. For an agent that replays a large, stable system prefix on every step, that turns the input side of the bill close to zero.

How V4-Flash-0731 scores on agent benchmarks

DeepSeek published a benchmark table on the model card comparing V4-Flash-0731 with the V4-Pro Preview, GLM-5.2, and Claude Opus-4.8. The scores below are DeepSeek's own figures; read the caveats that follow before you treat them as settled.

Benchmark V4-Flash-0731 V4-Pro (Preview) GLM-5.2 Opus-4.8
Terminal Bench 2.1 82.7 72.1 81.0 85.0
NL2Repo 54.2 38.5 48.9 69.7
Cybergym 76.7 52.7 not listed 83.1
DeepSWE 54.4 12.8 46.2 58.0
Toolathlon (verified) 70.3 55.9 59.9 76.2
Agents' Last Exam 25.2 16.5 23.8 25.7

The pattern is consistent: the smaller, cheaper model beats the larger V4-Pro Preview on every row, and sits within a few points of Opus-4.8 on Terminal Bench 2.1 and Agents' Last Exam. For a model that costs a fraction of a frontier flagship, being close on agentic coding is the whole argument.

The honest caveats matter. DeepSeek notes on the same card that its DeepSWE evaluation uses a "DeepSeek Harness" that will be released later, so third parties cannot reproduce that number yet. Two of the strongest results, DSBench-FullStack (68.7) and DSBench-Hard (59.6), come from internal test sets DeepSeek built. These are vendor-reported scores, not independent evaluations. Before you standardise on the model, run it against your own task set and your own passing bar.

How to point a coding agent at V4-Flash

DeepSeek's API is OpenAI-compatible, so most coding agents and SDKs need only a base URL and a model-name change. The base URL is https://api.deepseek.com, the model id is deepseek-v4-flash, and your existing OpenAI key handling stays the same shape (CloudZero).

A direct call to the OpenAI-compatible chat endpoint looks like this:


            curl https://api.deepseek.com/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $DEEPSEEK_API_KEY" \
  -d '{
    "model": "deepseek-v4-flash",
    "messages": [
      {"role": "system", "content": "You are a coding agent. Keep a stable system prefix so prompt caching applies."},
      {"role": "user", "content": "Refactor utils/date.py to remove the deprecated Date API."}
    ],
    "reasoning_effort": "high"
  }'
          

From the OpenAI Python SDK, the change is the base_url and model only:


            from openai import OpenAI

client = OpenAI(
    base_url="https://api.deepseek.com",
    api_key=os.environ["DEEPSEEK_API_KEY"],
)

resp = client.chat.completions.create(
    model="deepseek-v4-flash",
    reasoning_effort="high",   # low | high | max
    messages=[
        {"role": "system", "content": SYSTEM_PREFIX},   # keep this stable for cache hits
        {"role": "user", "content": task},
    ],
)
          

For teams standardised on OpenAI Codex, DeepSeek published an official Codex configuration path alongside the 0731 release, and the model supports the Responses API format natively (explainx). In practice you point Codex's model provider at the DeepSeek base URL and set the model to deepseek-v4-flash; check DeepSeek's current Codex documentation for the exact provider keys, since those evolve with each release. If you prefer the Anthropic message format, DeepSeek exposes an Anthropic-compatible endpoint as well.

Two configuration habits protect the price advantage. Keep your system prompt and tool definitions byte-for-byte stable across an agent's steps so the prefix cache keeps hitting, and reserve reasoning_effort: max for genuinely hard tasks, because higher effort spends more output tokens.

Cost math for a real coding-agent workload

Rates only matter once you multiply them by real token volumes. The token counts below are an illustrative assumption for one agentic coding turn, 50,000 input tokens (mostly repository context) and 8,000 output tokens; the per-token rates are the sourced figures from the table above.

Model Cost per turn (50K in / 8K out) Relative to V4-Flash
DeepSeek V4-Flash-0731 (cache miss) about $0.009 1x
DeepSeek V4-Flash-0731 (cached input) about $0.002 0.25x
OpenAI GPT-5.6 Luna about $0.020 2.2x
OpenAI GPT-5.3-Codex about $0.20 22x
OpenAI GPT-5.6 Sol about $0.49 53x

An agent that runs thousands of these turns a day is where the gap compounds. At 10,000 turns per day, the V4-Flash cache-miss path is about $90; the GPT-5.3-Codex path is about $2,000; the GPT-5.6 Sol path is about $4,900. Turn on prefix caching for the stable context and the V4-Flash figure drops further. This is the same unit-economics logic we walk through in cost per task for AI agents: the model's sticker price is less important than the effective rate after caching and routing.

Getting the cache to actually hit

The cache-hit rate is the single biggest lever on your effective bill, and most teams leave it on the floor. DeepSeek's prefix cache matches from the start of the prompt, so the rule is simple: keep everything that repeats at the front, and put everything that changes at the end. A fixed system prompt, a stable block of tool definitions, and any shared document preamble go first, byte-for-byte identical on every call. The user's changing request and the current file come last.

A worked example from CloudZero shows the size of the prize. A V4-Flash request with 100,000 cached input tokens and 10,000 output tokens costs about $0.003, against about $0.017 for the same request with no cache hit. Across 10,000 requests a day on one stable prompt pattern, that is roughly $140 saved per day, or $4,200 a month. The teams that pay least per request are not negotiating volume discounts; they are engineering cache-hit rates above 80 percent. Watch the hit rate in DeepSeek's dashboard, and if it sits below 50 percent, your prompt ordering is the first thing to fix.

When to escalate to V4-Pro, and when not to

Cheaper does not mean you should send everything to Flash. V4-Pro is a 1.6 trillion parameter model with a Codeforces rating of 3,206, and it exists for the reasoning problems Flash cannot solve in a single pass (CloudZero). The right pattern is a router: default to Flash, and escalate to Pro only when Flash's output fails a check, a test suite, or a confidence threshold.

The economics reward that discipline. At standard rates V4-Pro costs roughly 12x Flash, so a router that sends only the hard 5 to 10 percent of tasks to Pro keeps most of the savings while catching the cases that need more depth. We cover the mechanics of building that decision layer in our hybrid model-routing decision framework, and the broader field in the Gemini 3.5 Pro vs GPT-5.6 vs Claude Fable 5 comparison. One caution from the migration notes: the retired deepseek-reasoner alias now maps to Flash, not Pro, so if you relied on it for heavy reasoning you have to name deepseek-v4-pro explicitly.

India-specific considerations

For teams in India, the deployment path matters as much as the price. CloudZero notes that DeepSeek's hosted API runs on China-based infrastructure, which affects latency for Indian users and, more importantly, means any prompt carrying personal data is a cross-border transfer. Under the Digital Personal Data Protection Act 2023, that has to be handled deliberately, not by default.

There are two clean ways to keep the cost advantage without routing personal data offshore. The model is open-weight under an MIT licence, so you can self-host it on GPU infrastructure inside an Indian region; we work through that trade-off in the DeepSeek V4 self-hosted vs API break-even analysis. Alternatively, V4 is available as a managed model on Amazon Bedrock, Microsoft Azure AI Foundry, and Google Vertex AI, so you can run it in a region you control while your provider handles the serving. eCorpIT designs applications aligned with DPDP Act requirements; we do not claim a compliance certification we do not hold, and neither should any vendor you evaluate.

Migration and the retired aliases

If you already call DeepSeek, the switch is a one-line model change from deepseek-chat to deepseek-v4-flash, keeping the same base URL and key. The important date is the alias retirement: deepseek-chat and deepseek-reasoner stop working on July 24, 2026 at 15:59 UTC, after which calls using those names return errors (CloudZero). If you are reading this after that cutoff and still see errors, that alias is the reason. We keep a fuller checklist in our guide to migrating off the retired DeepSeek API aliases.

Limits and honest caveats

Three limits are worth stating plainly. The benchmark scores are DeepSeek's own, and at least one of them relies on a harness the company has not released, so independent confirmation is still pending. The API's China-based hosting is a real data-governance factor for regulated workloads, not a footnote. And the V4-Pro promotional pricing has fluctuated, so the exact escalation cost depends on the discount in force when you run the numbers. None of these erase the core result: a 1 million token, Codex-compatible coding model at $0.14/$0.28 per million tokens changes what a heavy agent workload costs to run.

FAQ

How eCorpIT can help

eCorpIT builds and operates coding-agent, RAG, and automation systems on cheap open-weight models without giving up quality or data control. We wire models like V4-Flash into existing OpenAI- and Codex-based tooling, design the routing layer that escalates only the hard tasks to a larger model, and set up prefix caching so the effective token bill stays low. For Indian workloads we design deployments aligned with DPDP Act 2023 data-residency requirements, whether self-hosted in-region or run as a managed model. To scope a migration or an agent build, contact our engineering team.

References

  1. DeepSeek-V4-Flash-0731 model card, Hugging Face
  1. DeepSeek pricing 2026: V4, R1, API costs, and how to optimize, CloudZero
  1. DeepSeek upgrades DeepSeek-V4-Flash-0731 with major agentic and coding gains, MarkTechPost
  1. DeepSeek retrained V4-Flash beats its flagship Pro on nine agent benchmarks, TechTimes
  1. DeepSeek's V4-Flash now beats its bigger sibling on agent benchmarks, AlphaSignal
  1. DeepSeek-V4-Flash-0731: Codex support, $0.14/$0.28 pricing, explainx
  1. DeepSeek V4 Flash 0731, intelligence, performance and price analysis, Artificial Analysis
  1. DeepSeek V4 Flash 0731, API pricing and benchmarks, OpenRouter
  1. OpenAI API pricing 2026: GPT-5.6, GPT-5.5, GPT-5.4 and Codex costs, DevTk.AI
  1. GPT-5.6 pricing explained: plans, API cost, Codex credits, GLBGPT
  1. Codex pricing and usage limits (July 2026), MorphLLM

_Last updated: August 2, 2026._

Frequently asked

Quick answers.

01 What is DeepSeek V4-Flash-0731?
DeepSeek V4-Flash-0731 is the official July 31, 2026 release of DeepSeek's V4-Flash model, a mixture-of-experts system with a 1 million token context and 384K maximum output. It supersedes the preview build, adds stronger agentic and coding behaviour, and ships under an MIT licence for self-hosting.
02 How much does V4-Flash cost per million tokens?
The hosted deepseek-v4-flash endpoint costs $0.14 per million input tokens on a cache miss, $0.0028 on a cache hit, and $0.28 per million output tokens, according to CloudZero's rate card. Cached prefixes cut input cost by about 98 percent, so effective spend depends heavily on how you structure prompts.
03 Can I use V4-Flash with OpenAI Codex?
Yes. DeepSeek published an official Codex configuration path and native Responses API support for deepseek-v4-flash. The API is OpenAI-compatible, so you point the base URL at api.deepseek.com, set the model to deepseek-v4-flash, and reuse existing Codex or OpenAI SDK code with only small changes.
04 Is V4-Flash better than V4-Pro for coding?
On DeepSeek's own July 31, 2026 benchmarks, V4-Flash-0731 outscores the larger V4-Pro Preview on all nine listed agent and coding tests, including Terminal Bench 2.1 at 82.7 versus 72.1. For the hardest multi-step reasoning, V4-Pro can still help, so benchmark your own tasks before switching everything.
05 What context window and output length does it support?
V4-Flash-0731 supports a 1 million token context window and up to 384,000 output tokens, matching V4-Pro. DeepSeek recommends the 384K maximum for the high and max reasoning-effort levels. That range makes full-codebase reading and long agent transcripts practical without the surcharges some competitors apply above 200K tokens.
06 How does V4-Flash pricing compare with OpenAI Codex models?
V4-Flash lists at $0.14 input and $0.28 output per million tokens. OpenAI's GPT-5.3-Codex is around $1.75 input and $14 output as of August 2026, roughly twelve times the input rate and fifty times the output rate, before DeepSeek's automatic cache-hit discount widens the gap even further.
07 Does routing code to DeepSeek raise DPDP concerns?
It can. CloudZero notes DeepSeek's API runs on China-based infrastructure, so Indian teams should treat prompts containing personal data as a cross-border transfer under the DPDP Act 2023. Self-hosting the MIT-licensed weights in-region, or using a managed copy on Bedrock, Azure, or Vertex, avoids that path.
08 Are the benchmark numbers independently verified?
Not fully. The scores come from DeepSeek's own model card. The DeepSWE result uses a DeepSeek Harness the company says will be released later, and the DSBench sets are internal, so third parties cannot yet reproduce every figure. Treat them as vendor-reported and test your own workload directly.

About the author

Manu Shukla

Founder & Director

Founder of eCorpIT. Hands-on engineer leading senior-only delivery for AI apps, custom software, and cloud systems for global clients.

Subscribe

One engineering note a week. No fluff, no spam.

Senior-architect playbooks on AI agents, mobile apps, cloud, security, data, and marketing — delivered every Wednesday.

Past the reading

Read enough. Let's build something.

A senior architect responds in 24 working hours with scope, indicative cost, and a timeline. NDA before any technical conversation.