How do I use DeepSeek in Claude Code?
Set ANTHROPIC_BASE_URL to https://api.stdcmpt.com, put a Standard Compute key in ANTHROPIC_AUTH_TOKEN and set ANTHROPIC_MODEL to deepseek/deepseek-v4.1-flash: Claude Code then runs on DeepSeek V4.1 Flash on a plan from $19 a month, and when the plan's compute budget reaches 100%, new requests get HTTP 402. Set the other model slots as below, or Claude Code's background calls fail with model_not_found.
# DeepSeek V4.1 Flash for the session, V4 Pro when you pick opus
# No /v1 here: Claude Code adds /v1/messages itself.
export ANTHROPIC_BASE_URL=https://api.stdcmpt.com
export ANTHROPIC_AUTH_TOKEN=YOUR_API_KEY
export ANTHROPIC_MODEL=deepseek/deepseek-v4.1-flash
export ANTHROPIC_DEFAULT_OPUS_MODEL=deepseek/deepseek-v4-pro
export ANTHROPIC_DEFAULT_SONNET_MODEL=deepseek/deepseek-v4.1-flash
export ANTHROPIC_DEFAULT_HAIKU_MODEL=deepseek/deepseek-v4.1-flash
export CLAUDE_CODE_SUBAGENT_MODEL=deepseek/deepseek-v4.1-flash
claude
Replace YOUR_API_KEY with a key from the dashboard. Exports last for one terminal; the settings.json env block keeps them for every session. The DeepSeek tab follows DeepSeek's own Claude Code guide.
What works with DeepSeek in Claude Code
| Claude Code feature | On DeepSeek through Standard Compute |
|---|---|
| Tools (Read, Edit, Bash, MCP) | Work. Claude Code's tool definitions reach DeepSeek as function calls and come back as tool_use blocks |
| Pasted screenshots | V4.1 Flash reads them. V4 Pro, in the opus slot, is text-only and answers an image with HTTP 400 |
| Thinking toggle | No effect. Reasoning is on by default; switch it off for V4.1 Flash on the Models page |
| WebSearch tool | Not available: the endpoint drops Anthropic's server tools |
| Context | Claude Code assumes 200K for these IDs and compacts there. Set CLAUDE_CODE_MAX_CONTEXT_TOKENS for more; requests stop at about 850K input |
| /model picker | Lists only IDs containing claude or anthropic. Use /model deepseek/deepseek-v4-pro or the variables |
From the gateway's Messages translation and Claude Code's model configuration docs, checked October 14, 2026.
What a day of DeepSeek costs
DeepSeek's prices are low enough that a plan is rarely the cheapest way to run V4.1 Flash on its own.
| Per day | DeepSeek API, peak | DeepSeek API, off-peak | V4 Pro, peak |
|---|---|---|---|
| Typical day | $0.42 | $0.21 | $1.94 |
| Busy day | $4.31 | $2.16 | $20 |
| 20 typical days | $8.49 | $4.25 | $39 |
DeepSeek list prices per million tokens: V4.1 Flash (deepseek-flash) $0.30 input, $0.006 cache hit, $1.20 output at peak, half off-peak; V4 Pro $1.32, $0.044, $3.96 at peak. Peak is 01:00 to 04:00 and 06:00 to 10:00 UTC on weekdays. Source. A typical day is 8.5M tokens and a busy one 86.7M, 87.2% of input as cache reads: the median and 90th-percentile coding-agent day in our Agent Burn Index, measured on OpenCode, Cline, Kilo and similar agents, September 13 to October 12, 2026. Priced at the list rates above; your own days will differ.
Why V4 Pro sits in the opus slot
DeepSeek's own endpoint maps Claude Code's opus name to V4 Pro and the sonnet and haiku names to Flash. The config keeps that split, so /model opus moves a hard step to deepseek/deepseek-v4-pro and back. V4 Pro costs about 5 times as much per day as Flash at peak.
The catch
If DeepSeek is the only model you use, DeepSeek's own Anthropic endpoint, https://api.deepseek.com/anthropic, costs less than any plan, especially off-peak. It ignores Claude Code's cache markers and thinking budgets but caches repeated prefixes by itself, so caching still works there. A plan pays off when DeepSeek is one of several models you switch between, or when you want spending to stop at a fixed amount.
Where Standard Compute fits
/model opus moves a hard step to V4 Pro, and /model anthropic/claude-sonnet-5.5 moves it to Claude, on the same key. At DeepSeek's peak list price the Starter ($19 a month, $20 of compute) plan covers about 47 typical V4.1 Flash days.
FAQ
Can I use DeepSeek's model name deepseek-flash here?
No, it returns model_not_found. Use deepseek/deepseek-v4.1-flash, or the short form deepseek-v4.1-flash. deepseek-flash is the name on DeepSeek's own API.
Why do I get model_not_found when only ANTHROPIC_MODEL is set?
Claude Code still asks for its own names for subagents and background calls, and its sonnet name currently resolves to claude-sonnet-5-5, which this endpoint does not accept. Set ANTHROPIC_DEFAULT_OPUS_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL, ANTHROPIC_DEFAULT_HAIKU_MODEL and CLAUDE_CODE_SUBAGENT_MODEL as in the config above.
Does DeepSeek in Claude Code use prompt caching?
Yes, on the provider side. DeepSeek caches repeated prompt prefixes automatically, and coding-agent prompts are mostly repeats, so most input is billed at the cache-hit rate. There is nothing to set.
Does my Claude Pro or Max subscription pay for this?
No. While ANTHROPIC_AUTH_TOKEN holds a gateway key, Claude Code sends that key instead of your claude.ai login, so the subscription's limits and billing do not apply. Remove the variables to go back to it.