AI News

DeepSeek V4 Flash in Codex: 20 Real Coding Tasks, Cost, and Failure Rate

DeepSeek V4 Flash won the scorecard and lost the stopwatch. In my predeclared 20-task repository test, run through Codex with hidden tests, it produced 19 accepted fixes for a metered API cost of $0.3433. My normal Codex model accepted 17. DeepSeek, however, took 1.93 times as much aggregate agent time and generated nearly four times as many input tokens.

The million-token context window was not the reason it won. DeepSeek’s longest request reached 125,580 input tokens—just 12.6% of the 996,147-token effective window exposed to Codex. There were no compactions or context-overflow errors on either backend.

Bottom line: DeepSeek V4 Flash is a remarkably cheap and capable Codex backend for public or policy-approved code. In this sample it was more reliable than my normal Codex model, but substantially slower and much more verbose in its tool loop. The 1M context window was useful as headroom, not as a demonstrated advantage.

Editorial disclosure: Kingy.ai bought the API credits used in this test. DeepSeek did not supply access, choose the tasks or review the article.

The result in one table

Metric DeepSeek V4 Flash Normal Codex model
Model deepseek-v4-flash gpt-5.6-sol
Accepted tasks 19/20 (95%) 17/20 (85%)
Failure rate 5% 15%
Accepted on first attempt 19 17
Correction attempts 0 3; none rescued the task
Human code corrections 0 0
Regressions in accepted patches 0 0
Median wall time 4m 46s 2m 24s
Aggregate agent time 1h 56m 43s 1h 00m 29s
Patch-application failures 0 0
Transport/API errors 0 0
Input tokens 33.98M; 97.44% cached 8.88M; 89.03% cached
Output tokens 460,485 100,907
Recorded model requests 723 289
Peak request context 125,580 / 996,147 (12.6%) 63,236 / 258,400 (24.5%)
Metered task cost $0.3433 total; $0.0181 per accepted task No separate per-task bill on the existing ChatGPT/Codex plan

The score is for this 20-task cohort, not a 95% claim on the full SWE-bench Verified leaderboard. The sample is also Python-heavy: 19 issues came from pytest and one from Requests. That concentration makes the paired comparison controlled, but limits how far the result should be generalized.

What I actually tested

DeepSeek now publishes an official DeepSeek-to-Codex integration guide. This is a custom model-provider path through the Responses API, not a claim that DeepSeek is a built-in OpenAI provider or that the companies have a partnership. As of August 2, 2026, DeepSeek says only deepseek-v4-flash supports the integration. Its model catalog specifies a 1,048,576-token window, 95% effective context and Codex 0.144.0 or newer.

I ran Codex CLI 0.146.0-alpha.9.2 on an Apple M4 Pro MacBook Pro with 24GB of memory, macOS 26.3 and native arm64 Python 3.9.6 environments. Both backends used high reasoning effort. RunPod was unnecessary: DeepSeek V4 Flash is served by DeepSeek’s hosted API, while the repository and tests ran locally.

The tasks were selected before either counted model run from the SWE-bench Verified dataset, a human-validated set of real GitHub issue and pull-request pairs. Each model received the same issue text and a clean repository snapshot at the pre-fix base commit. The snapshot contained one synthetic commit, no remote and no later upstream history. Network access was disabled.

The hidden test patch was not present during the primary run. Each agent had 15 minutes to inspect the repository, edit production code and run any existing tests it chose. I then applied the held-out tests. A patch was accepted only when every defect-revealing test and every predeclared regression test passed. Across the cohort, that meant 36 fail-to-pass tests and 1,357 pass-to-pass tests.

If a completed primary attempt failed held-out tests, the model received the failure output and one seven-minute correction turn. An infrastructure retry was permitted only for a broken run, not for a weak patch. I made no manual code edits. One early pilot was discarded because the synthetic repository version made pytest report itself as version 0.1; I corrected the harness and restarted both models from clean workspaces before counting results.

This was a native macOS paired test, not the official SWE-bench Docker harness, and it covers only two repositories. Treat it as a controlled product trial, not a leaderboard submission.

All 20 repository tasks

Wall time includes the correction turn where one was used. DeepSeek cost includes cached input, uncached input and all output—including reasoning tokens—at the listed API rates.

# Issue DeepSeek Codex Time: DS / Codex DS cost
1 pytest-10051: caplog records and clear conflict Pass Pass 9:05 / 2:16 $0.0180
2 pytest-10081: skipped unittest teardown under PDB Pass Pass 2:06 / 2:06 $0.0071
3 pytest-10356: class marks must follow MRO Pass Fail after correction 10:25 / 4:37 $0.0245
4 pytest-5262: encoded capture-file mode Pass Pass 1:08 / 1:45 $0.0061
5 pytest-5631: collecting a patched array Pass Pass 2:36 / 2:31 $0.0089
6 pytest-5787: chained-exception serialization Pass Pass 8:26 / 3:40 $0.0319
7 pytest-5809: pastebin lexer HTTP error Pass Pass 0:58 / 1:18 $0.0062
8 pytest-5840: Windows conftest path casing 15-minute timeout Fail after correction 15:00 / 5:03 $0.0419
9 pytest-6197: stray __init__.py collection Pass Pass 12:05 / 5:36 $0.0421
10 pytest-6202: malformed test-report headline Pass Pass 1:45 / 2:11 $0.0071
11 pytest-7205: BytesWarning in setup display Pass Fail after correction 2:30 / 4:37 $0.0102
12 pytest-7236: skipped unittest teardown under PDB Pass Pass 5:06 / 2:09 $0.0175
13 pytest-7324: crash on debug Python 3.8+ Pass Pass 13:02 / 2:56 $0.0367
14 pytest-7432: --runxfail skip location Pass Pass 3:23 / 3:19 $0.0098
15 pytest-7490: dynamically added xfail marker Pass Pass 11:18 / 7:44 $0.0239
16 pytest-7521: carriage-return conversion Pass Pass 1:16 / 1:24 $0.0071
17 pytest-7571: caplog level restoration Pass Pass 5:18 / 1:34 $0.0109
18 pytest-7982: symlinked-directory collection Pass Pass 1:27 / 1:23 $0.0080
19 pytest-8399: unittest class-fixture visibility Pass Pass 5:23 / 2:36 $0.0091
20 requests-5414: malformed URL UnicodeError Pass Pass 4:26 / 1:45 $0.0164

Where each model failed

DeepSeek’s only miss was pytest-5840, the Windows path-casing issue. It used the entire 15-minute allowance across 61 recorded model requests and reached the study’s largest single request, 125,580 input tokens. It did not finish an evaluable production patch. Calling the untouched regression tests “regressions” would be misleading, so I scored this as a timeout with no accepted patch.

The normal Codex model completed all 20 primaries but missed three defects:

  • pytest-10356: the proposed class-mark/MRO patch left the new defect test failing. All 79 regression tests remained green.
  • pytest-5840: both new Windows path-casing tests still failed. All 51 regression tests remained green.
  • pytest-7205: all 10 new bytes-parameter display tests still failed. All 16 regression tests remained green.

Each received one correction turn using the hidden-test output; none was rescued. Neither backend edited the held-out tests, and no accepted patch introduced a regression.

Tool calls: much more activity from DeepSeek, but no broken patches

DeepSeek generated 806 recorded function calls and 44 patch operations, compared with 265 function calls and 35 patch operations for the normal Codex model. That larger loop tracks the token and wall-time gap: DeepSeek inspected and tested more, even on tasks both models solved.

There were zero API/stream error events and zero failed patch applications on both backends. The benchmark sandbox accidentally omitted rg from its executable path. Each model tried it once on every task, got the same 20 recoverable “command not found” results, and switched to available search tools. I report that nuisance separately rather than pretending it differentiates model reliability. Non-zero test commands used to reproduce defects are likewise diagnostic evidence, not tool failures.

The actual bill: 34 cents, or 1.8 cents per accepted task

DeepSeek lists V4 Flash at $0.14 per million uncached input tokens, $0.0028 per million cached input tokens and $0.28 per million output tokens. The counted runs used:

  • 869,195 uncached input tokens: $0.1217
  • 33,110,912 cached input tokens: $0.0927
  • 460,485 output tokens: $0.1289

Total: $0.3433. Spread across the 19 accepted tasks—including the cost of the failed timeout—that is $0.0181 per accepted task. The median individual run cost $0.0105; the range was $0.0061 to $0.0421.

The wallet check supports the token ledger. I funded the account with $2 and finished at $1.62. Roughly four cents belonged to the discarded preflight; the counted batch rounds to 34 cents. Total project spend was therefore 38 cents, comfortably below the $10 cap.

My normal Codex backend ran against an existing ChatGPT/Codex subscription, so there was no separate usage charge to assign to these 20 tasks. Reporting “$0 per task” as though the service itself were free would be false precision. The defensible comparison is DeepSeek’s metered API cost versus no incremental line item on the already-paid plan.

One pricing caveat: DeepSeek has announced future peak-hour pricing at twice the regular rates, but its pricing page did not list an effective date when this test ran. Recheck the live page before budgeting a large batch.

Did the 1M context window matter?

Not in this cohort. The official model catalog gives DeepSeek V4 Flash a 1,048,576-token raw window and 95% effective capacity. Codex reported 996,147 usable tokens. The peak request used 125,580—12.6% of that capacity. My normal Codex model peaked at 63,236 of 258,400 usable tokens, or 24.5%.

Neither backend compacted its history or hit a context error. DeepSeek’s 33.98 million input tokens are cumulative across 723 requests, not a single giant prompt. Its automatic prefix cache absorbed 97.44% of those input tokens, which is why repeatedly resending a growing agent history stayed cheap.

The large window did provide measurable headroom during the 15-minute timeout: the session kept expanding without compression. But it did not convert that persistence into a fix. A fair conclusion is that the 1M window remained available and stable, while this test did not establish a quality benefit from it. A monorepo task that genuinely crosses 250,000 tokens would be a different experiment.

Codex compatibility has edges

DeepSeek’s Responses API compatibility documentation matters more than the setup steps. The API is stateless: it does not support previous_response_id, stored conversations or automatic truncation. Codex therefore resends history, and requests that exceed the context window return an HTTP 400 instead of being trimmed.

Function calls, web search and Codex’s custom apply_patch tool are supported. Several OpenAI built-in tool types—including file search, code interpreter, computer use and MCP—are ignored by the DeepSeek endpoint. Image and file inputs are replaced with placeholder text. That is enough for the shell-and-patch workflow tested here, but it is not full feature parity with every Codex workflow.

The privacy limit is real

I used public open-source repositories. DeepSeek’s privacy policy says it may collect prompts and uploaded files, may use interactions to train and improve its technology, offers a right to opt out of training use, and directly collects, processes and stores personal data in the People’s Republic of China.

That does not make V4 Flash unusable, but it changes the default for proprietary code. Review the current policy, account controls, contracts and your organization’s data-handling requirements before pointing the backend at a private repository. Low token prices are not a substitute for an approved data path.

Verdict

DeepSeek V4 Flash is more than a cheap novelty inside Codex. On these 20 real repository issues it delivered the higher accepted-task rate, needed no hidden-test correction turns, applied patches cleanly and cost less than two cents per accepted fix.

The trade is time and agent traffic. It took almost twice as long overall, made about three times as many function calls and used nearly four times as many input tokens. Automatic caching kept the cash cost tiny, but it did not make the workflow fast.

My recommendation: use V4 Flash when metered cost is the main constraint, the repository is public or approved for DeepSeek processing, and a slower unattended loop is acceptable. Keep the normal Codex backend close when turnaround time, broader tool compatibility or data governance matters more. The 1M window is promising insurance for very long jobs; this test shows the insurance was present, not that I needed to claim it.

FAQ

Is DeepSeek V4 Flash built into Codex?

No. DeepSeek publishes configuration that registers its hosted API as a custom Codex model provider. Codex supports custom providers through its configuration system, and DeepSeek supplies a compatible model catalog and Responses endpoint.

Does it need RunPod or a local GPU?

No. V4 Flash inference ran on DeepSeek’s hosted API. The M4 Pro Mac only hosted the repositories, Codex client and test environments.

How much did the benchmark cost?

The 20 counted DeepSeek runs cost $0.3433. Including a discarded harness preflight, the account spent $0.38 in total. That works out to $0.0181 per accepted task for the counted benchmark.

Was the one-million-token context useful?

It prevented no observed compaction and left ample room, but no request exceeded 125,580 tokens. The experiment therefore demonstrated headroom, not a quality gain from the full window.

Can I use it on private code?

Technically, yes; operationally, review DeepSeek’s current privacy terms and your organization’s policy first. This benchmark deliberately used only public repositories.

Sources and reproducibility notes

Test date: August 2, 2026 (Pacific Time). Prices, model availability and policies can change. All benchmark arithmetic was reconstructed from Codex rollout token records, run metadata and held-out test results; the balance check was used as an independent billing sanity check.