Codex DeepSeek: Use DeepSeek V4 Flash & Pro in Codex
This guide shows you how to add DeepSeek V4 Flash and DeepSeek V4 Pro to the Codex App or CLI using Codex Router. Once set up, both models appear in the normal Codex model picker next to the native GPT models, and your DeepSeek API key never leaves your machine.
What you can add
| Picker label | Model ID | Authentication |
|---|---|---|
| DeepSeek V4 Flash (API) | deepseek/deepseek-v4-flash | DeepSeek API key |
| DeepSeek V4 Pro (API) | deepseek/deepseek-v4-pro | DeepSeek API key |
DeepSeek V4 is also available through other providers in the router — for example ollama-cloud/deepseek-v4-pro (an Ollama Cloud account) and qwen-plan/deepseek-v4-pro (an Alibaba Model Studio plan). Those entries intentionally coexist because credentials and billing differ. This page covers the vendor-direct DeepSeek provider.
Requirements
- The Codex App or CLI, plus Node.js 22.19+ and
uvor Python 3.10+ (see the installation guide). - A DeepSeek API key from the DeepSeek platform. DeepSeek API access is a separate account and billing system from every other provider — including Kimi, Anthropic and xAI — and from your ChatGPT login.
Enable the provider
Install the router if you have not already (see install), then store your key and enable the provider:
./bin/model-router codex provider-key deepseek set
./bin/model-router codex providers enable deepseek
The set command opens a hidden prompt — terminal echo is disabled, so the key never lands in shell history. The key is stored in a per-user protected file (mode 600 on POSIX, a current-user ACL on Windows) and is reported only as present or absent by diagnostics.
Never paste a DeepSeek key into chat, a command argument, or a tracked file. The router only ever sends it to the configured DeepSeek endpoint, and only for requests that select a DeepSeek model.
On Windows, run the same commands through the wrapper: ./codex-router.ps1 codex provider-key deepseek set and ./codex-router.ps1 codex providers enable deepseek.
Verify the integration
./bin/model-router codex doctor
./bin/model-router codex providers
The provider must report SHOW and ready. Then fully quit Codex, reopen it, create a new task, and open the model picker — DeepSeek V4 Flash and V4 Pro should be listed. You can confirm the startup catalog with codex debug models. If the entries are missing, see models missing from the picker.
For a live, quota-consuming check of one model:
./bin/test-model 'deepseek/deepseek-v4-pro' --live --yes
How DeepSeek requests behave
The router selects the exact official upstream model ID, enables thinking, and maps Codex reasoning levels to DeepSeek’s supported high and max values. Sampling parameters that DeepSeek documents as ineffective in thinking mode are removed before the request is sent. Both current V4 models share the same forwarder and the same stored credential, so enabling the provider covers both picker entries.
Older DeepSeek aliases remain hidden compatibility routes. They are not advertised to new users, but old CLI commands keep working as long as DeepSeek continues serving those upstream aliases.
Common pitfalls
- DeepSeek keys are not interchangeable. A Kimi, Anthropic or Alibaba key cannot authenticate DeepSeek requests, and a DeepSeek key cannot authenticate anything else. The router keeps each provider’s key in its own protected file.
- The picker is credential-aware. If DeepSeek does not appear, the key may be missing or the provider disabled — not a router bug. Re-run
providersanddoctor. - Provider policy risk. Model providers may restrict or block proxy traffic. Routing DeepSeek through Codex Router is at your own risk; check DeepSeek’s terms before relying on it for production work.
- Plan resellers bill separately. If you enable DeepSeek via an Ollama Cloud or Alibaba plan key instead, usage is billed by that account, not by DeepSeek.
Official links
Related: models overview, Kimi in Codex, GLM in Codex, troubleshooting.