Claude Code (Part 12)
Neil Haddley • May 8, 2026
Using the DeepSeek API with Claude Code as a cheap, fast alternative to local models
In Part 11 I used ollama launch claude to run Claude Code backed by a local model — qwen3-coder:30b running entirely on the Mac Studio, consuming 41 GB of RAM. It worked well, but it was slow (3m 40s for the breakout game) and pinned the machine while it ran.
This time I tried a different approach: pointing Claude Code at the DeepSeek API. DeepSeek exposes an Anthropic-compatible endpoint, so by setting three environment variables — ANTHROPIC_BASE_URL, ANTHROPIC_API_KEY, and ANTHROPIC_MODEL — Claude Code routes through DeepSeek's cloud models instead of either Anthropic's API or a local Ollama model. No RAM pressure, near-instant responses, and at a fraction of the cost: the whole session — 5 API requests and 114,235 tokens — came to less than $0.01.
The trade-off is that your prompts and code go to an external service rather than staying on-device. For a toy game that's fine — for sensitive codebases the local Ollama approach is the safer choice.
I started by creating a DeepSeek API key.
Then I exported the three environment variables and launched Claude Code.
BASH
1export ANTHROPIC_API_KEY="sk-..." && export ANTHROPIC_MODEL="deepseek-chat" && export ANTHROPIC_BASE_URL="https://api.deepseek.com/anthropic" && claude
I used the same prompt as Part 11 to make it an easy comparison.
PROMPT
1create a web page breakout game
The account had no credit yet, so I topped it up.


















