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.1 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.
Setup (2 minutes)
Section titled “Setup (2 minutes)”- Subscribe to the Core Pool and copy
your subscriber key (
sk-...) from the dashboard. - Export these variables in your shell (or put them in your shell profile):
export ANTHROPIC_BASE_URL="https://api.cheapestinference.com/anthropic"export ANTHROPIC_AUTH_TOKEN="sk-..." # your subscriber keyexport ANTHROPIC_MODEL="deepseek-v4.1-flash"export ANTHROPIC_SMALL_FAST_MODEL="deepseek-v4.1-flash"- Start
claudeas usual. Every request now runs on DeepSeek.
Why DeepSeek V4.1 Flash for Claude Code
Section titled “Why DeepSeek V4.1 Flash for Claude Code”- Fast: V4.1 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
thinkingcontent blocks, so Claude Code renders it natively. See Reasoning for toggling it.
Per-project configuration
Section titled “Per-project configuration”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.1-flash", "ANTHROPIC_SMALL_FAST_MODEL": "deepseek-v4.1-flash" }}Can Claude Code use DeepSeek?
Section titled “Can Claude Code use DeepSeek?”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.1-flash, and Claude Code runs on DeepSeek — tool calls, streaming
and thinking blocks included. No plugin or proxy on your machine.
Is DeepSeek good enough for Claude Code?
Section titled “Is DeepSeek good enough for Claude Code?”For most day-to-day coding, yes: V4.1 Flash handles multi-file edits and tool loops well. 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.
Does /compact and auto-compaction work?
Section titled “Does /compact and auto-compaction work?”Yes, with no extra configuration: Claude Code compacts the session automatically as it grows, and if a request is ever rejected as too long it compacts and retries on its own.
- 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.3 (Frontier Pool) or Kimi K3 (Flagship Pool).
- General setup, model table and troubleshooting: the main Claude Code guide.