DEV Community

Cover image for I ran Claude Code on DeepSeek V4.1 Flash. It cost 2 cents. Claude Code said 96.
Manpreet Singh
Manpreet Singh

Posted on Originally published at singhlabs.dev AI-assisted

I ran Claude Code on DeepSeek V4.1 Flash. It cost 2 cents. Claude Code said 96.

Short answer: yes, Claude Code runs on DeepSeek V4.1 Flash, with nine environment variables. I gave it one real coding task, three times, on fresh copies of a repo. All three passed my own checks. Each run cost about 2 cents at DeepSeek's off-peak price. Claude Code showed between $0.87 and $1.28 for the same runs, because it prices a model it doesn't recognise at Claude Opus 5's rates.

DeepSeek shipped the 1017 update of V4.1 Flash on 17 October, and benchmarked it inside Claude Code itself. Benchmarks are someone else's task. I wanted mine.

On DeepSeek, Claude Code's cost counter is wrong by about 50×. It prices tokens from a model it doesn't recognise as Claude Opus 5.

The setup

These are DeepSeek's own recommended settings for Claude Code, plus one line of mine at the top:

export CLAUDE_CONFIG_DIR=~/.claude-deepseek     # mine: any empty folder
export ANTHROPIC_BASE_URL=https://api.deepseek.com/anthropic
export ANTHROPIC_AUTH_TOKEN=<your DeepSeek API key>
export ANTHROPIC_MODEL=deepseek-flash[1m]
export ANTHROPIC_DEFAULT_OPUS_MODEL=deepseek-flash[1m]
export ANTHROPIC_DEFAULT_SONNET_MODEL=deepseek-flash[1m]
export ANTHROPIC_DEFAULT_HAIKU_MODEL=deepseek-flash
export CLAUDE_CODE_SUBAGENT_MODEL=deepseek-flash
export CLAUDE_CODE_EFFORT_LEVEL=max
export CLAUDE_CODE_AUTO_COMPACT_WINDOW=786432
Enter fullscreen mode Exit fullscreen mode

The separate config folder means the run can't touch my Claude login, my own CLAUDE.md files or my plugins. Every run started from the same blank setup.

The task

Add a --json option to bridle's agents check, our open-source AGENTS.md linter. With the flag, print one JSON object. Without it, the text report must not change by a single character. Add a test for a passing file and a failing one, then run the whole suite.

Small, but real: the report was printed line by line straight to the screen, so the code had to be reshaped without changing what it prints. Each run got a fresh clone and ran unattended with claude -p.

Did it work? I checked, not its summary

All three runs said they passed. Here's what I checked myself, on each one:

$ node --test
# tests 8
# suites 0
# pass 8
# fail 0
Enter fullscreen mode Exit fullscreen mode

Eight of eight: the six old tests and its two new ones. Then the part tests miss. I ran the new code and the original on all 32 AGENTS.md and CLAUDE.md files from our study of 25 famous repos. The text output was identical on all 32, in all three runs. And the new flag does what it says:

$ node bin/bridle.mjs agents vscode-AGENTS.md --json
{"file":"vscode-AGENTS.md","verdict":"FAIL","failures":1,"lines":["Linting vscode-AGENTS.md","","  · no command blocks — reading this as a policy file, not a project file","  ✘ pointer file: under 80 words, the rest is a link — an agent that does not follow it gets nothing","  ✔ no unfilled placeholders","  ✔ nothing in here tells the agent to do something dangerous","  ! only 0 prohibition(s) — nothing here says what the agent must never touch","  ✔ size: 33 words ≈ 68 tokens, re-sent every turn","","FAIL — 1 problem(s). Your agent is reading this file on every run."]}
Enter fullscreen mode Exit fullscreen mode

One thing I didn't ask for: all three runs also added an entry to LOG.md. The repo's own CLAUDE.md says every change gets logged. The prompt said "do not change anything else". It followed the file over the prompt, and said so in its summary. Your CLAUDE.md still rules, whichever model is behind it.

The numbers

Run Turns Time Tokens: new / cached / out Claude Code showed DeepSeek charged
1 · effort max 31 93 s 44,065 / 632,192 / 17,123 $0.96 $0.019
2 · effort max 42 123 s 43,284 / 970,880 / 22,957 $1.28 $0.023
3 · effort high 26 91 s 38,074 / 605,312 / 14,896 $0.87 $0.017

"DeepSeek charged" is the token counts times DeepSeek's off-peak list price. The account balance agrees: it went from $0.49 to $0.46 across all three runs.

Why the counter is wrong

$ python -c "..." run-max1.json   # fields from Claude Code's JSON result
num_turns            31
input_tokens         44065
cache_read_tokens    632192
output_tokens        17123
total_cost_usd       0.964496
costBasis            unknown
Enter fullscreen mode Exit fullscreen mode

Claude Code also printed [claude-code:unrecognized_model] {"model":"deepseek-flash[1m]","query_source":"sdk"}. It doesn't know DeepSeek's prices, so it falls back to a Claude model's. Those token counts at Claude Opus 5's list prices ($5 per million in, $0.50 cached, $25 out) come to exactly $0.964496. If you budget off that number, you're out by about 50×, in the safe direction at least.

The cache works, just not Claude Code's

DeepSeek's docs say its Anthropic endpoint ignores Claude Code's cache_control markers. It caches on its own anyway: 94.6% of input tokens across the three runs were cache hits, at $0.003 per million instead of $0.15. That matters because Claude Code re-sends the whole session every turn. On my own history, re-sent context was 97.5% of all tokens. The cached price is the price that counts.

So is it cheaper than Claude?

Here's the same token mix, averaged over the three runs, at each list price:

Model Per run
DeepSeek V4.1 Flash, off-peak $0.020
Claude Haiku 5.5 $0.021
DeepSeek V4.1 Flash, peak hours $0.039
Claude Sonnet 5.5 $0.34
Claude Opus 5.5 $0.68
Claude Fable 5.1 $1.52

Against Sonnet and Opus, DeepSeek is about 17 to 35 times cheaper. Against Claude Haiku 5.5, it's about the same, and at peak hours Haiku is cheaper. Peak is 01:00–04:00 and 06:00–10:00 UTC on weekdays, which in India is much of the working morning.

Read that table carefully. It prices DeepSeek's tokens at Claude's rates. A Claude model would take a different number of turns and tokens. I didn't run Haiku 5.5 on this task, so whether it passes is untested. What it does tell you: the cheap end of the market is now cents per task, and the question is which model passes your checks, not which one is cheap.

What I'd watch

  • Ignore the cost counter on any non-Claude model. Read your provider's bill.

  • "Max" effort isn't free. My two max runs took 31 and 42 turns; the high run took 26. Three runs are a sample, not a trend.

  • Check the work, not the summary. All three summaries were accurate this time. The only way I know that is that I ran the checks.


Sources: three runs on 19 Oct 2026 between 12:47 and 12:52 UTC (DeepSeek off-peak), Claude Code 2.1.257, each on a fresh clone of bridle at commit d439619, run with claude -p --output-format json --permission-mode acceptEdits. Token counts are from Claude Code's JSON result. Prices: DeepSeek's models and pricing page and its Claude Code guide; Anthropic's pricing page; all read 19 Oct 2026. The Claude rows price uncached input at the base rate and skip cache-write premiums, so real Claude runs would cost a little more. The terminal blocks are real; the test output is trimmed to its summary lines, and the JSON field list was read out of Claude Code's result with a short Python one-liner.

Read next: Output was 0.2% of my Claude Code tokens · We checked the AGENTS.md files of 25 famous repos


Originally published at singhlabs.dev.

Top comments (1)

Collapse
 
godnick profile image
Henry Godnick •

Great catch on the 50x mispricing. A handy cross-check is to pull the input/output token counts from the session transcripts and multiply by DeepSeek's off-peak rates yourself, because the provider's own billing dashboard is the only real source of truth when the model isn't recognized. Disclosure: I built TokenBar, a Mac menu bar tracker for Claude, Codex and other AI usage and cost, and posts like this are a good reminder that per-model pricing has to be configurable.