Has anyone swapped the provider under Claude Code or Codex CLI to DeepSeek and kept working the same way?

The two clients get there differently, and in both cases the editor, the commands and the permissions stay untouched. 🔌

DeepSeek also works behind OpenCode, Aider, LiteLLM and local Ollama.

Claude Code reaches it over an Anthropic-compatible endpoint, set in the window you launch from:

$env:ANTHROPIC_BASE_URL="https://api.deepseek.com/anthropic"
$env:ANTHROPIC_AUTH_TOKEN="sk-YOUR_DEEPSEEK_KEY"
$env:ANTHROPIC_MODEL="deepseek-flash[1m]"

claude

Codex CLI goes over the Responses API, and the published script writes the provider section, the model catalog and a backup of what it replaced:

irm https://cdn.deepseek.com/api-docs/codex-deepseek-setup-en.ps1 | iex

The reason to do this is cost: at current API rates, cache-miss input plus output per million tokens, DeepSeek Flash is ~7-17x cheaper than Claude Sonnet 5 and ~7-20x cheaper than GPT-5.6 Terra, depending on peak or off-peak and on input against output.

That makes it a strong default for repository exploration, tests, docs, boilerplate, routine refactors, CI fixes and subagent loops. For ambiguous architecture, hard debugging, security review and risky migrations, I would still escalate to a frontier Claude or GPT model.

This compares API rates against API rates, so a fixed monthly subscription is not directly comparable.

If Codex lists the DeepSeek model and the requests still go to the OpenAI endpoint, the provider section is missing and the app has not been fully restarted. 🔧

Do not casually send API keys, .env files, production credentials or large database dumps to a cloud model. For confidential code, prefer local inference or a provider whose retention policy matches your requirements.

https://api-docs.deepseek.com/