Codex speaks the OpenAI protocol — so putting DeepSeek V4 Pro in it is exactly two environment variables.
What is DeepSeek V4 Pro?
DeepSeek V4 Pro is DeepSeek's flagship reasoning model — up to 1M tokens of context and multiple reasoning-effort levels. It's the "hard problems" tier of the V4 generation; its fast sibling V4 Flash handles cheap high-frequency work. (For a fully open-source agent harness around the same family, see DeepSeek Harness — dsh — but for OpenAI-native tooling like Codex, the model plugs straight in.)
The setup:
export OPENAI_BASE_URL="https://api.teamorouter.com/v1"
export OPENAI_API_KEY="sk-teamo-your-key"
Then point Codex at the model:
codex --model deepseek-v4-pro-free "Introduce yourself in one sentence"
That's the entire setup. Codex is built on the OpenAI SDK, so any OpenAI-compatible endpoint works.
The one thing that trips everyone
OPENAI_BASE_URL must include /v1. The OpenAI SDK appends /chat/completions, so a missing /v1 gives you a 404. Use https://api.teamorouter.com/v1 — not the bare domain.
Profile approach: route by task
Don't want all of Codex on DeepSeek? Use a profile. In ~/.codex/config.toml:
[profiles.teamorouter-pro-free]
base_url = "https://api.teamorouter.com/v1"
api_key = "sk-teamo-your-key"
model = "deepseek-v4-pro-free"
Then:
codex --profile teamorouter-pro-free "Refactor src/services/reporting.py"
This keeps your default GPT-5.6 profile alongside the DeepSeek profile — heavy work on native Codex GPT, daily high-frequency work on cheap DeepSeek V4.
The free tier, inside Codex
deepseek-v4-pro-free gives 200 requests/day (counted by request, not tokens):
- Daily edits — single-file changes cost 3–5 requests, so 200 covers a dozen+.
- Long loops — multi-step refactors cost 10–20 each, so 200 covers 3–5 hard tasks.
-
Quota exhausted — switch to
deepseek-v4-pro(flat $1.74/$3.48, no account limit).
For light work (commit messages, explanations), use deepseek-v4-flash-free (also 200/day) and save Pro for hard jobs.
Quick troubleshooting
-
404 / can't connect → missing
/v1inOPENAI_BASE_URL. -
401 → key not applied or copied incompletely; confirm it starts with
sk-teamo-. -
Can't switch models → model names are lowercase with
-(deepseek-v4-pro-free).
Put V4 Pro into Codex → Get a key on TeamoRouter
Top comments (0)