← All guides

How to use DeepSeek in Claude Code

DeepSeek is one of the cheapest capable coding models around, and Claude Code isn't actually locked to Anthropic. Here's exactly how to route Claude Code through DeepSeek, what to watch for, and a cleaner path if you'd rather just pick the model from a list.

TL;DR: DeepSeek now exposes an Anthropic-compatible endpoint, so you can run Claude Code on it by setting ANTHROPIC_BASE_URL to DeepSeek's Anthropic base and ANTHROPIC_AUTH_TOKEN to your DeepSeek key, then selecting a DeepSeek model. It's very cheap per token and good for everyday coding, but it's still one global endpoint — to switch back to Claude you edit env vars and restart. If you want to flip between DeepSeek and Claude in a click, use an agent that treats the model as a setting.

Yes — Claude Code can run on DeepSeek

Claude Code sends requests to whatever endpoint its config points at. DeepSeek publishes an Anthropic-compatible endpoint specifically so tools built for the Anthropic Messages API can use it directly — which means you can point Claude Code at DeepSeek without any translating proxy. You bring your own DeepSeek key, and usage is billed to you (at DeepSeek's very low rates).

The config

What to set

  1. ANTHROPIC_BASE_URLPoint it at DeepSeek's Anthropic-compatible base URL (the /anthropic endpoint), not the default OpenAI-style one.
  2. ANTHROPIC_AUTH_TOKENYour DeepSeek API key — usage is billed to your DeepSeek account.
  3. ModelSet the model to the DeepSeek model you want (e.g. its chat/coder model). Match the name the endpoint exposes.
# Point Claude Code at DeepSeek's Anthropic-compatible endpoint
export ANTHROPIC_BASE_URL="https://api.deepseek.com/anthropic"
export ANTHROPIC_AUTH_TOKEN="your-deepseek-key"
# then run claude as usual, selecting a DeepSeek model
Reality check: this rewires Claude Code globally. There's no in-app 'use DeepSeek for this task, Claude for that one' — to switch you change env vars and restart. Tool-calling quality also varies by model, so test on a real task before trusting it for heavy agent loops.

Why people route Claude Code to DeepSeek

DeepSeek vs staying on Claude

ReasonWhat it gets youTradeoff
CostA fraction of the per-token price for routine codingSlightly different strengths per task
No Claude limitsSidestep Claude plan rate limits / quotaYou manage a second key
FallbackSomething to switch to when Claude is capped or downManual switch via env vars

The cleaner option: pick the model, don't rewire env vars

The endpoint swap works, but you're bending Claude Code — a single-provider tool — into multi-model use. If your real goal is "run DeepSeek for cheap most of the time, jump to Claude for the hard stuff," it's far less friction to use an agent where DeepSeek and Claude are both just entries in a model list. No env-var editing, no restart-to-switch.

What that looks like with Wuwei

DeepSeek is one entry in the list

Pick it in the UI; Claude, GLM, Kimi, Qwen and OpenAI-compatible endpoints sit right next to it.

One-click switch

Move between DeepSeek and Claude mid-workflow without touching config or restarting.

Free and local

The agent is free and MIT-licensed, runs on your machine, and reads your real files. You only pay DeepSeek's usage.

FAQ

Can Claude Code use DeepSeek?

Yes. DeepSeek exposes an Anthropic-compatible endpoint, so you set ANTHROPIC_BASE_URL to DeepSeek's /anthropic base and ANTHROPIC_AUTH_TOKEN to your DeepSeek key, then select a DeepSeek model. No translating proxy is needed.

Is DeepSeek cheaper than Claude for coding?

Per token, yes — DeepSeek is one of the lowest-cost capable coding models, which is why people route Claude Code to it for routine work and keep Claude for the hardest tasks.

How do I switch between DeepSeek and Claude easily?

Use an agent where the model is a setting, not a global env var. Wuwei is a free, open-source example — DeepSeek and Claude are both in the model list, so you switch in a click instead of editing config and restarting.

If you want to code with DeepSeek's cheap, capable model — and still jump to Claude when you need it — Wuwei is a free, open-source agent where both are one click apart. Bring your own DeepSeek key, pick the model from a list, and run it locally on your real files.

Windows · macOS · Linux — free, no login