DeepSeek
DeepSeek
Claude Code DeepSeek

Claude Code DeepSeek setup

Keep the Claude Code terminal agent, swap the brain to DeepSeek V4. The UI stays Claude Code; requests go to DeepSeek’s Anthropic-compatible endpoint.

Commands follow DeepSeek’s published Claude Code integration. Anthropic does not officially support this backend swap. If something breaks, check the official API docs first.

What Claude Code DeepSeek actually is

Claude Code is the agent shell: it edits files, runs the terminal, and understands slash commands. DeepSeek V4 Pro / Flash is the model. DeepSeek documents https://api.deepseek.com/anthropic so Claude Code can keep sending Anthropic-style requests without rewriting the tool. You install @anthropic-ai/claude-code, then point ANTHROPIC_BASE_URL at DeepSeek and ANTHROPIC_AUTH_TOKEN at your DeepSeek API key.

This is not a new DeepSeek model, and it is not DeepSeek Harness. Harness is DeepSeek’s own agent runtime (npx @deepseek-ai/dsh web). Claude Code DeepSeek is “Claude Code as the harness, DeepSeek as the brain.” Deep Code is a different free OSS coding CLI. All three default to the hosted DeepSeek API — you do not download Hugging Face weights for this setup.

When to use this setup

Reach for Claude Code DeepSeek when the shell you already know is Claude Code:

  • You want Claude Code’s files/terminal/slash-command UX, billed at DeepSeek token rates.
  • Your team already has Claude Code muscle memory and only needs a cheaper or open-weight-friendly brain.
  • You map Opus-class work to deepseek-v4-pro and Haiku/subagents to deepseek-v4-flash.
  • You can use the CLI or the VS Code extension with ~/.claude/settings.json.

What this is not

Do not confuse the shell with the model or with DeepSeek’s own runtime:

  • Not a new model ID. You still call deepseek-v4-pro or deepseek-v4-flash.
  • Not DeepSeek Harness and not Deep Code.
  • Not an Anthropic-supported backend swap. Preview features that need Anthropic’s own backend may fail.
  • Not Claude Desktop OAuth. Desktop login does not read these env vars the same way — use CLI or VS Code.

At a glance

Shell
Claude Code (npm i -g @anthropic-ai/claude-code)
Endpoint
https://api.deepseek.com/anthropic
Opus-class →
deepseek-v4-pro
Haiku / subagent →
deepseek-v4-flash
GPU
Not required (hosted API)
Keys
Official DeepSeek platform — not this site

Install, env, settings.json

Need Node.js 18+. Windows also needs Git for Windows. Then install, set variables, or write settings.json so new terminals keep the mapping.

  1. Install: npm install -g @anthropic-ai/claude-code
  2. Check: claude --version
  3. Set ANTHROPIC_BASE_URL=https://api.deepseek.com/anthropic and ANTHROPIC_AUTH_TOKEN to your DeepSeek API key.
  4. Map Opus/Sonnet-class names to deepseek-v4-pro[1m]; Haiku and CLAUDE_CODE_SUBAGENT_MODEL to deepseek-v4-flash.
  5. For persistence, write ~/.claude/settings.json (Windows: %USERPROFILE%\.claude\settings.json).

Linux / macOS

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_OPUS_MODEL=deepseek-v4-pro[1m]
export ANTHROPIC_DEFAULT_SONNET_MODEL=deepseek-v4-pro[1m]
export ANTHROPIC_DEFAULT_HAIKU_MODEL=deepseek-v4-flash
export CLAUDE_CODE_SUBAGENT_MODEL=deepseek-v4-flash
export CLAUDE_CODE_EFFORT_LEVEL=max

Windows PowerShell (current session)

$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_OPUS_MODEL="deepseek-v4-pro[1m]"
$env:ANTHROPIC_DEFAULT_SONNET_MODEL="deepseek-v4-pro[1m]"
$env:ANTHROPIC_DEFAULT_HAIKU_MODEL="deepseek-v4-flash"
$env:CLAUDE_CODE_SUBAGENT_MODEL="deepseek-v4-flash"
$env:CLAUDE_CODE_EFFORT_LEVEL="max"

~/.claude/settings.json

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.deepseek.com/anthropic",
    "ANTHROPIC_AUTH_TOKEN": "<your DeepSeek API Key>",
    "ANTHROPIC_MODEL": "deepseek-v4-pro[1m]",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "deepseek-v4-pro[1m]",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "deepseek-v4-pro[1m]",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "deepseek-v4-flash",
    "CLAUDE_CODE_SUBAGENT_MODEL": "deepseek-v4-flash",
    "CLAUDE_CODE_EFFORT_LEVEL": "max"
  }
}

Claude Code vs Harness vs Deep Code

Same DeepSeek API, different shells:

OptionRoleWhen to pick it
Claude Code DeepSeekKeep Claude Code UI, DeepSeek brainYou already live in Claude Code
DeepSeek HarnessDeepSeek’s own plugin runtimeYou want npx @deepseek-ai/dsh web
Deep CodeFree OSS coding CLI + VS Code, V4-nativeYou do not need the Claude Code UI
Web appChat first, no agent configYou have not locked a prompt yet
DeepSeek APIOpenAI-compatible, your productYou are shipping, not pairing an IDE agent

Limits to know

  • Claude Desktop OAuth will not pick up these variables like the CLI does.
  • Web Search inside Claude Code can add extra DeepSeek token cost.
  • If you leave default claude-opus / claude-haiku names, DeepSeek maps them — but explicit deepseek-v4-* IDs are clearer.
  • Model IDs such as deepseek-v4-pro[1m] follow current official docs; they can change.
  • This site does not issue API keys. Get them on the official platform.

Related guides

FAQ

Is Claude Code DeepSeek an official joint product?

DeepSeek documents the Anthropic-compatible endpoint. Anthropic does not officially support swapping the backend. Treat it as a documented integration, not a joint Anthropic + DeepSeek product. If a Claude Code preview needs Anthropic’s own backend, it may not work.

Do I need a GPU?

No. Claude Code talks to https://api.deepseek.com/anthropic. Inference runs on DeepSeek’s hosted API. You need Node.js locally, not a GPU, unless you point BASE_URL at a server you host yourself.

Pro or Flash?

Map Opus/Sonnet-class work to deepseek-v4-pro (often with the [1m] suffix in DeepSeek’s examples). Map Haiku-class names and CLAUDE_CODE_SUBAGENT_MODEL to deepseek-v4-flash. That matches DeepSeek’s published Claude Code examples.

Where do I get the API key?

From the official DeepSeek platform. This site does not issue keys. Then set ANTHROPIC_AUTH_TOKEN to that key and ANTHROPIC_BASE_URL to https://api.deepseek.com/anthropic.

Claude Code, Harness, or Deep Code?

Keep the Claude Code UI? This page. Want DeepSeek’s own plugin runtime? Harness (npx @deepseek-ai/dsh web). Want a free OSS coding CLI tuned for V4? Deep Code. All three call the DeepSeek API by default.

Do I download Hugging Face weights?

No for this setup. Claude Code talks to the hosted Anthropic-compatible endpoint. Weights are only if you self-host an OpenAI-style server and point BASE_URL there.

Why does Claude Desktop ignore my env vars?

Desktop OAuth login does not read ANTHROPIC_BASE_URL the same way as the CLI. Use `claude` in a terminal or the VS Code extension with settings.json.