DeepSeek quietly rebuilt deepseek-v4-flash today. On four graded tasks it tied GLM-5.2 on three, won the fourth, and cost 19x less to run — except GLM-5.2 is still the higher-scoring model on paper, and the reason it lost my fourth task is a trap you can walk into on purpose.
That trap is reasoning budget. Through the endpoint I tested, GLM-5.2 reasoned at length even on short prompts, and on one spec-heavy task it spent 16,000 output tokens without ever emitting an answer. Flash finished the same task in 2,525 tokens.
What the 0731 update changed for deepseek-v4-flash
DeepSeek's own API docs now list the model version for deepseek-v4-flash as DeepSeek-V4-Flash-0731. The invocation method is unchanged and the alias still resolves to the newest build, so nothing in your code breaks, and nothing tells you the model underneath moved.
The update carries no changelog entry on that pricing page, and DeepSeek's news index showed no July 2026 entry when I checked it on 2026-07-31. The consequence for reading any comparison: a published Flash score measures whichever build was live when the test ran, so check both the evaluation date and the variant, because "Flash Base," "Flash (Reasoning)," and "Flash (Reasoning, Max Effort)" are three different rows with different numbers.
The same docs page confirms the specs that matter for a head-to-head: 1M context, a 384K maximum output, thinking mode on by default with a non-thinking mode available, and a 2,500 concurrency limit against Pro's 500. The Responses API currently supports only deepseek-v4-flash, with deepseek-v4-pro slated for early August 2026.
Same four tasks, both models: what actually happened
I sent both models identical prompts through an OpenAI-compatible relay on 2026-07-31, with thinking left at its default and max_tokens at 8,000 unless noted, and graded the output mechanically rather than by eye. The two coding tasks were executed against hidden test cases (6 and 8 respectively); the JSON task was checked key-by-key against the requested schema; the retrieval task had exactly one correct string.
| Task | DeepSeek V4 Flash (0731) | GLM-5.2 |
|---|---|---|
| t1 — find and fix an interval-merge edge case | 6/6 tests, 5.0s, 361 out | 6/6 tests, 19.0s, 990 out |
t2 — implement next_version() to an 8-rule spec | 8/8 tests, 29.9s, 2,525 out | no answer returned |
| t3 — strict JSON, exact keys, no fence | pass, 5.2s, 327 out | pass, 11.2s, 826 out |
| t4 — retrieve and combine 3 facts from ~45K tokens | correct, 5.2s, 172 out | correct, 9.7s, 317 out |
Three of four are honest ties. Both models found the same bug in t1 — a strict < that fails to merge touching intervals like (1,4) and (4,5) — and both shipped the identical one-character fix. Both nailed the strict-JSON task byte-for-byte. Both got t4 right, combining a secret buried at record 211 with a rule at record 1290 to return quartz-mallard-90.
t2 is the outlier, and it deserves precision rather than a victory lap. GLM-5.2 did not answer incorrectly — it never answered. At an 8,000-token cap it burned all 8,000 on reasoning and returned empty content after 110s. I re-ran it at 16,000 to rule out my own cap being the culprit: 16,000 tokens consumed, still empty, 214s. A third attempt at 24,000 errored out after 301s. Flash produced a function passing all eight cases, including the three that must raise ValueError.
Limits worth stating plainly: this is n=1 per task on one relay endpoint, not a benchmark. Reasoning tokens are billed inside completion_tokens here, and the official Z.ai endpoint may stream or account for them differently. What I'd defend from this data is the shape, not a precise ratio: GLM-5.2 spends far more tokens and wall-clock per task.
Where GLM-5.2 is genuinely ahead
GLM-5.2 is the stronger model by the measures the industry actually uses, and a cheap-wins-everything read of my results would be wrong. Artificial Analysis puts GLM-5.2 (max) at 51 on its Intelligence Index against 40 for DeepSeek V4 Flash (Reasoning, Max Effort) — an 11-point gap, on a much larger model: 753B total and ~40B active, versus Flash's 284B total and 13B active.
Z.ai's published figures for GLM-5.2 land where you'd expect a flagship: SWE-bench Pro 62.1%, Terminal-Bench 2.1 81.0, AIME 2026 99.2%, GPQA Diamond 91.2%, and HLE with tools 54.7%. These are vendor-reported, and Flash has no comparable entry on most of them.
That absence is the honest headline on benchmarks: the two models share essentially no evaluations. Model-tracking site benchlm compares them and declines to name a winner, noting the pair has zero like-for-like rows. Flash's public numbers come from a base-model suite (MMLU 88.7%, HumanEval 69.5%, GSM8K 90.8%), GLM-5.2's from an agentic-coding suite.
Knowledge is the one category where they overlap, and there benchlm has GLM-5.2 ahead, 59.6 to 56.4. When two comparison pages disagree about this matchup, the usual cause is that they scored different variants against different suites. Trust the number whose variant and date match what you plan to call.
Practitioners describe the split the same way I measured it. From an r/opencodeCLI thread running the same task on both:
GLM 5.2 reasons hard on everything. V4 scales it, almost no wind-up on the simple fix, GLM 5.2 pulls ahead on anything that is not banally [simple] …
That is the trade in one line: GLM-5.2's reasoning is an asset on hard problems and pure overhead on easy ones.
The cost gap is wider than the price sheet
Start with list prices, both verified on the vendors' own pages on 2026-07-31.
| Per 1M tokens | DeepSeek V4 Flash | GLM-5.2 | GLM multiple |
|---|---|---|---|
| Input (cache miss) | $0.14 | $1.40 | 10.0x |
| Input (cache hit) | $0.0028 | $0.26 | 92.9x |
| Output | $0.28 | $4.40 | 15.7x |
| Max output | 384K | 128K | — |
Then apply those rates to the tokens each model actually spent on my four tasks, and the gap widens past the 15.7x output ratio, because the pricier model is also the more verbose one:
| Task | Flash in→out | Flash cost | GLM-5.2 in→out | GLM-5.2 cost | Multiple |
|---|---|---|---|---|---|
| t1 bug fix | 165→361 | $0.000124 | 170→990 | $0.004594 | 37.0x |
| t2 implement | 182→2,525 | $0.000732 | 196→16,000 | $0.070674 | 96.5x |
| t3 strict JSON | 171→327 | $0.000116 | 177→826 | $0.003882 | 33.5x |
| t4 long-context | 45,225→172 | $0.006380 | 44,164→317 | $0.063224 | 9.9x |
| All four | 45,743→3,385 | $0.007352 | 44,707→18,133 | $0.142375 | 19.4x |
Every prompt was sent cold, so all input is billed at the cache-miss rate; multiply the columns above by the table before it to reproduce any figure.
t4 is the narrowest gap at 9.9x: when a job is input-heavy the 10x input ratio dominates and output verbosity stops mattering, which is the one workload shape where GLM-5.2's premium stays contained.
DeepSeek's pricing page states the API "will soon adopt a peak/off-peak pricing policy" at 2x across all billing items for 09:00–12:00 and 14:00–18:00 Beijing time (UTC+8), effective date pending announcement, which would cut Flash's output advantage to roughly 5x during Asian business hours. Pulling the other way, Flash's cache-hit input at $0.0028 is 93x cheaper than GLM-5.2's $0.26, so replaying a large stable prefix widens the gap. And if your use is coding specifically, Z.ai's Coding Plan starts at $18/month with GLM-5.2 included and off-peak usage at half rate, which is a different bill from the per-token rates above.
Which one to call, by workload
| Workload | Call | Why |
|---|---|---|
| High-volume simple-to-mid coding edits | V4 Flash | Same answer as GLM-5.2 on my t1, 3.8x faster, 37x cheaper |
| Strict-format / structured output at scale | V4 Flash | Byte-identical result at 1/34th the cost |
| Long-context retrieval over big documents | V4 Flash | Same correct answer; narrowest cost gap but still 9.9x |
| Hard agentic or multi-file coding | GLM-5.2 | 51 vs 40 Intelligence Index, and its own agentic suite is where it scores |
Anything with a tight max_tokens | V4 Flash | GLM-5.2 returned nothing at 8K and 16K caps on my t2 |
| Output over 128K tokens in one call | V4 Flash | 384K max output vs GLM-5.2's 128K |
Treat this as a cost-routing default to validate rather than a settled rule, since it rests on one four-task run: route to Flash, escalate to GLM-5.2 for the subset of tasks where a wrong answer costs more than 19x the token spend. If you do run GLM-5.2, give it room, because a cap that would be generous for Flash can produce a paid non-answer.
One thing this comparison cannot settle: no third-party re-score of Flash has appeared since 0731 landed today, so the 51-vs-40 gap describes the April build. The current capability distance is unmeasured, and the only way to size it for your workload is to run your own evals against both aliases.
FAQ
Is DeepSeek V4 Flash 0731 a new model or an update?
An update to the existing model, not a new one. DeepSeek's docs list the version as DeepSeek-V4-Flash-0731 and state the invocation method is unchanged, so deepseek-v4-flash keeps resolving to the newest build with no code change on your side.
Did DeepSeek V4 Flash beat GLM-5.2?
Not on capability: Artificial Analysis scores GLM-5.2 (max) at 51 against 40 for DeepSeek V4 Flash (Reasoning, Max Effort). Flash won on cost per solved task, tying three of four graded tasks at 19.4x lower total cost.
Is GLM-5.3 out yet?
Not as of 2026-07-31: GLM-5.2 is the newest entry on Z.ai's own pricing table and its Coding Plan model list, neither of which carries a 5.3 row.
Which is cheaper for a 1M-token context job?
DeepSeek V4 Flash, by 10x on cache-miss input and 93x on cache-hit input. My ~45K-token retrieval task cost $0.006380 on Flash versus $0.063224 on GLM-5.2.
Can I use both in Claude Code?
Yes, both vendors document an Anthropic-format endpoint. DeepSeek lists https://api.deepseek.com/anthropic alongside its OpenAI-format base URL, and Z.ai's Claude Code guide has you set ANTHROPIC_BASE_URL to https://api.z.ai/api/anthropic and map the Sonnet and Opus slots to glm-5.2[1m].
Related reading
Sources
- DeepSeek Models & Pricing — 0731 version note, prices, peak/off-peak policy, verified 2026-07-31
- Z.ai pricing — GLM-5.2 rates, verified 2026-07-31
- Z.ai Coding Plan — subscription tiers and GLM-5.2 coverage, verified 2026-07-31
- Z.ai: Claude Code setup — Anthropic-compatible base URL and model mapping
- DeepSeek news index — checked 2026-07-31, no July 2026 entry
- Artificial Analysis: GLM-5.2 vs DeepSeek V4 Flash — Intelligence Index, parameters
- benchlm: DeepSeek V4 Flash Base vs GLM-5.2 — shared-benchmark coverage, knowledge scores
- r/opencodeCLI: DeepSeek V4 vs GLM 5.2 for coding — practitioner report