Stays
Claude Code CLI, repository workflow, commands and tool interface
DeepSeek claude code
Keeping the Claude Code harness and terminal experience does not require keeping the same model backend. DeepSeek provides an Anthropic-compatible route, so you can change or split the model layer while preserving the client workflow.
What changes and what stays
Claude Code CLI, repository workflow, commands and tool interface
API endpoint, API key, backend model and billing account
The client name is not proof of the backend model. Once Claude Code points to DeepSeek's Anthropic-compatible base URL and key, requests and billing follow that configured route.
Official setup
Checked August 11, 2026. DeepSeek requires Node.js 18 or newer for a fresh Claude Code install; Windows also requires Git for Windows. Obtain the API key from the official DeepSeek platform.
export ANTHROPIC_BASE_URL=https://api.deepseek.com/anthropic
export ANTHROPIC_AUTH_TOKEN=<your DeepSeek API Key>
export ANTHROPIC_MODEL=deepseek-v4-pro[1m]
export ANTHROPIC_DEFAULT_HAIKU_MODEL=deepseek-v4-flash
export CLAUDE_CODE_SUBAGENT_MODEL=deepseek-v4-flash$env:ANTHROPIC_BASE_URL="https://api.deepseek.com/anthropic"
$env:ANTHROPIC_AUTH_TOKEN="<your DeepSeek API Key>"
$env:ANTHROPIC_MODEL="deepseek-v4-pro[1m]"
$env:ANTHROPIC_DEFAULT_HAIKU_MODEL="deepseek-v4-flash"
$env:CLAUDE_CODE_SUBAGENT_MODEL="deepseek-v4-flash"Use the live guide as the configuration source
The blocks above retain the endpoint, key and primary/worker route needed to understand the setup. The official example also includes timeout, auto-compact and effort settings. Copy the current official values when configuring a machine rather than treating this page as a frozen install script.
Current model routing
Opus-class labels
DeepSeek's current generic mapping sends model names beginning with claude-opus to the Pro route.
Sonnet / Haiku-class labels
The generic mapping sends model names beginning with claude-sonnet or claude-haiku to Flash.
deepseek-v4-pro[1m], while the model-mapping section describes the generic Sonnet-prefix route as Flash. An explicit environment override is configuration; the prefix table describes default gateway mapping. Verify both sections before changing a live setup.Why this is a routing decision
This is a workload-design suggestion, not an official performance promise or a Modroam benchmark result.
Start with the Pro route
Validate on a representative task
Test the Flash route
Measure corrections, latency and cost
Keep Claude or another trusted review layer
Production review is a separate responsibility
Web Search and hidden cost
DeepSeek says its Claude Code route can invoke Web Search. Search results require additional model requests to summarize retrieved content, so those calls add token cost.
Tool calls, long context, retries, search behavior and failed attempts all affect end-to-end cost. Compare completed tasks, not only the advertised input-token price.
When not to switch
Safe first test
Inspect files without changing them.
Explain the repository architecture and identify uncertainties.
Propose one bounded change without writing it.
Make one small edit after you approve the plan.
Compare result quality, corrections, total cost and elapsed time with your current model.