Skip to content

Use DeepSeek with Claude Code

Claude Code doesn’t require a Claude model: it works with any backend that speaks the Anthropic Messages API. CheapestInference exposes DeepSeek V4 Flash through an Anthropic-compatible endpoint, so you can run Claude Code on DeepSeek with unlimited usage during your reserved time blocks — a flat monthly fee instead of per-token billing.

  1. Subscribe to the Core Pool and copy your subscriber key (sk-...) from the dashboard.
  2. Export these variables in your shell (or put them in your shell profile):
Terminal window
export ANTHROPIC_BASE_URL="https://api.cheapestinference.com/anthropic"
export ANTHROPIC_AUTH_TOKEN="sk-..." # your subscriber key
export ANTHROPIC_MODEL="deepseek-v4-flash"
export ANTHROPIC_SMALL_FAST_MODEL="deepseek-v4-flash"
export CLAUDE_CODE_AUTO_COMPACT_WINDOW=1000000 # DeepSeek V4 Flash's 1M window
  1. Start claude as usual. Every request now runs on DeepSeek.
  • 1M-token context: the whole repo fits. Setting CLAUDE_CODE_AUTO_COMPACT_WINDOW to the full window means long sessions compact far less often than on a 200K model.
  • Fast: V4 Flash is DeepSeek’s speed-optimized line — agentic loops with many tool calls stay snappy.
  • Flat price: coding agents are token-hungry; a long Claude Code session can burn millions of tokens. During your time blocks there is no per-token meter — see Unlimited Subscriptions.
  • Thinking blocks: DeepSeek’s reasoning surfaces through standard Anthropic thinking content blocks, so Claude Code renders it natively. See Reasoning for toggling it.

Pin one project to DeepSeek without touching your global shell profile with .claude/settings.json in the project:

{
"env": {
"ANTHROPIC_BASE_URL": "https://api.cheapestinference.com/anthropic",
"ANTHROPIC_AUTH_TOKEN": "sk-...",
"ANTHROPIC_MODEL": "deepseek-v4-flash",
"ANTHROPIC_SMALL_FAST_MODEL": "deepseek-v4-flash",
"CLAUDE_CODE_AUTO_COMPACT_WINDOW": "1000000"
}
}

Yes. Claude Code talks to any endpoint that implements the Anthropic Messages API. Point ANTHROPIC_BASE_URL at https://api.cheapestinference.com/anthropic, set ANTHROPIC_MODEL to deepseek-v4-flash, and Claude Code runs on DeepSeek — tool calls, streaming and thinking blocks included. No plugin or proxy on your machine.

For most day-to-day coding, yes: V4 Flash handles multi-file edits and tool loops well, and its 1M window holds far more of the repo than a 200K model. For the hardest refactors, flagship-class models like Kimi K3 leave a bigger quality margin — same setup, different model id.

What does it cost to run Claude Code on DeepSeek?

Section titled “What does it cost to run Claude Code on DeepSeek?”

A flat monthly subscription to the Core Pool — see current prices. Usage during your reserved time blocks is unlimited, so a heavy Claude Code week costs the same as a light one. On per-token APIs the same agentic session bills every one of its millions of tokens.

Yes. Set CLAUDE_CODE_AUTO_COMPACT_WINDOW=1000000 so Claude Code compacts against DeepSeek’s real 1M window instead of assuming a Claude-sized one.

  • Your Core Pool subscription also covers MiMo v2.5 — switch models by changing ANTHROPIC_MODEL, no new key needed.
  • Want a stronger model in the same setup? The same two variables work with GLM 5.2 (Frontier Pool) or Kimi K3 (Flagship Pool).
  • General setup, model table and troubleshooting: the main Claude Code guide.