Skip to content

How to Run DeepSeek V4 With Claude Code on Windows

Run DeepSeek V4 with Claude Code on Windows using its Anthropic-compatible endpoint. API key, environment variables, model choice, pricing, and the common fixes.

MGMCSA Guru Team June 16, 2026 4 min read
Claude Code on Windows configured to run on DeepSeek V4 via environment variables

DeepSeek is the cheapest credible way to keep using Claude Code. It ships an Anthropic-compatible endpoint, so you don’t need a proxy or a router — point Claude Code at DeepSeek with two environment variables and your workflow stays identical while the per-token cost drops to a fraction of Anthropic’s.

This is the native-Windows setup: API key, environment variables, picking the right model, and the errors people hit. Prefer WSL? See run DeepSeek V4 with Claude Code on WSL. For the wider picture, see use cheap AI models with Claude Code.

Step 1: Get a DeepSeek API key

Create an account on the DeepSeek platform, add a few dollars of credit, and generate an API key. Pay-per-token rates are low, so a small top-up goes a long way. Keep the key somewhere safe — you’ll set it as an environment variable, not paste it into a file.

Step 2: Make sure Claude Code is installed

npm install -g @anthropic-ai/claude-code

Step 3: Point Claude Code at DeepSeek

DeepSeek’s Anthropic-compatible endpoint is the key. In PowerShell, set three variables for the session:

$env:ANTHROPIC_BASE_URL = "https://api.deepseek.com/anthropic"
$env:ANTHROPIC_AUTH_TOKEN = "sk-your-deepseek-key"
$env:ANTHROPIC_MODEL = "deepseek-chat"
claude

That’s the whole setup. Claude Code now runs on DeepSeek.

To make it persistent across reboots, use setx (note: setx affects new terminals, not the current one):

setx ANTHROPIC_BASE_URL "https://api.deepseek.com/anthropic"
setx ANTHROPIC_AUTH_TOKEN "sk-your-deepseek-key"
setx ANTHROPIC_MODEL "deepseek-chat"

Step 4: Pick the right model

DeepSeek models for Claude Code

deepseek-chat General coding; fast and cheapest
deepseek-reasoner Thinking mode for harder problems

Set ANTHROPIC_MODEL to whichever you want. Use deepseek-chat for everyday work and switch to deepseek-reasoner when a task needs deeper reasoning — it costs more and is slower, so it’s not the default.

Pricing and what to expect

DeepSeek is pay-per-token only — there’s no flat coding plan. It’s among the cheapest serious models, often a fraction of Anthropic’s rates, and it applies cache-hit discounts when prompts repeat context. It also runs off-peak discount windows where the rate drops during set hours, which is worth scheduling heavy work around.

Because these rates shift with promotions and new versions, treat any figure as a snapshot and confirm on DeepSeek’s official pricing page. Full breakdown: DeepSeek V4 pricing explained.

Verify it’s working

claude
# then: "summarize this repo and list the main entry points"

If it reads files and answers normally, DeepSeek is serving Claude Code. Switch models by changing ANTHROPIC_MODEL and reopening the terminal.

Troubleshooting

  • Auth errorsANTHROPIC_AUTH_TOKEN isn’t set in the current shell, or the key is invalid. setx only affects new terminals, so open a fresh one.
  • Format/streaming errors — you’re on the /v1 URL; switch to /anthropic.
  • “Model not found” — check the exact model ID against DeepSeek’s docs.
  • Still hitting Anthropic — a previously set variable is overriding yours; confirm with echo $env:ANTHROPIC_BASE_URL.

DeepSeek + Claude Code checklist

  • DeepSeek API key created and funded
  • Claude Code installed
  • ANTHROPIC_BASE_URL set to the /anthropic endpoint
  • ANTHROPIC_AUTH_TOKEN and ANTHROPIC_MODEL set
  • Tested on a small task

Wrapping up

Running DeepSeek with Claude Code on Windows is three environment variables: the /anthropic base URL, your auth token, and the model. No proxy needed. Use deepseek-chat for everyday coding and deepseek-reasoner when you need deeper thinking, and time heavy jobs for the off-peak discount.

For a cleaner shell experience, do it in WSL. To use DeepSeek with other agents instead, see DeepSeek with Codex CLI or DeepSeek + OpenCode.

Frequently asked questions

Can Claude Code run on DeepSeek without a proxy?

Yes. DeepSeek ships an Anthropic-compatible endpoint, so you point Claude Code at it with ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN — no Claude Code Router or other proxy required.

Which DeepSeek model should I use?

deepseek-chat is the general coding model (fast, cheap); deepseek-reasoner enables the thinking mode for harder problems. Set ANTHROPIC_MODEL to the one you want. Start with deepseek-chat and switch to the reasoner for tricky tasks.

How much does DeepSeek cost compared to Claude?

DeepSeek is pay-per-token only and among the cheapest credible models — typically a fraction of Anthropic's rates, with cache-hit discounts. Exact numbers change with promotions and versions, so confirm on DeepSeek's official pricing page before relying on them.

Does DeepSeek have a coding plan or subscription?

No. DeepSeek is pay-as-you-go per token, with no flat monthly coding plan. It does run periodic off-peak discount windows that lower the rate during set hours — check the pricing page for current times.

Will my code be sent to DeepSeek's servers?

Yes — like any cloud model, your prompts and relevant code go to DeepSeek's API to be processed. For sensitive or proprietary code, review the provider's data policy or run a local model instead.

Sources & further reading

Official vendor documentation referenced while writing this guide.

MG

MCSA Guru Team

IT & Systems Administration

We are working IT pros and system administrators who spend our days in Windows Server, Microsoft 365, and the wider Microsoft stack. MCSA Guru is where we write down the fixes and walkthroughs we wish we had found the first time.

MCSA Guru provides independent, educational IT guidance. Microsoft, Windows, Windows Server, Microsoft 365, Exchange, and Microsoft Teams are trademarks of Microsoft Corporation; Docker is a trademark of Docker, Inc. MCSA Guru is not affiliated with or endorsed by Microsoft or Docker. Always test changes in a safe environment before applying them in production.

Related guides

Fixing something right now?

Jump straight into the guide library or search for the exact error or task you are dealing with.