DeepSeek Codex Setup: One-Click Script, Flash vs Pro
📑 Table of Contents
Introduction
Search DeepSeek Codex setup, and many people still assume you need a local reverse proxy before OpenAI’s Codex can talk to DeepSeek. You do not.
The DeepSeek API natively supports the Responses API that Codex depends on. Configure ~/.codex once, and Codex CLI, the ChatGPT desktop app, and the VS Code Codex extension all share it. This site is an independent community; treat the official Integrate with Codex guide as source of truth for steps, and the pricing page for rates and peak windows.

I. What Codex Needs — and What DeepSeek Provides
Codex talks to models through the Responses API. Pointing Chat Completions alone at DeepSeek is not enough to act as a Codex backend. DeepSeek implements the protocol server-side at https://api.deepseek.com/; the critical config is wire_api = "responses".
The official model catalog declares both deepseek-v4-flash and deepseek-v4-pro. Prefer Flash for daily coding and repo sweeps; switch to Pro for hard reasoning and large refactors. Model IDs and keys: DeepSeek API.
If you want DeepSeek’s own open-source agent runtime instead of the Codex client, see What is DeepSeek Harness. For Anthropic-compatible Claude Code wiring, use the site’s Claude Code DeepSeek guide. Three paths — do not merge them into one config.
II. One-Click Script: Fastest DeepSeek Codex Setup
Prerequisites: Codex CLI or the ChatGPT desktop app installed and launched at least once (so ~/.codex exists). Create an API key on the DeepSeek Platform (sk- prefix).
macOS / Linux:
bash <(curl -fsSL https://cdn.deepseek.com/api-docs/codex-deepseek-setup.sh)
Windows (PowerShell):
irm https://cdn.deepseek.com/api-docs/codex-deepseek-setup-en.ps1 | iex
The script backs up config.toml to ~/.codex/backup-deepseek/, writes models.json, rewrites only required fields plus [model_providers.deepseek], and validates syntax before writing. Re-run the menu to switch models or restore the pre-install config.
III. Manual Config: Minimal config.toml
If you skip the script, still let the official script or docs generate models.json (it includes long system prompts — do not hand-copy the full file). Keep config.toml close to:
model = "deepseek-v4-flash"
model_provider = "deepseek"
preferred_auth_method = "apikey"
forced_login_method = "api"
model_reasoning_effort = "high"
model_catalog_json = "~/.codex/models.json"
[model_providers.deepseek]
name = "deepseek"
base_url = "https://api.deepseek.com/"
wire_api = "responses"
experimental_bearer_token = "<your DeepSeek API Key>"
Watch these fields: wire_api = "responses"; set model to deepseek-v4-flash or deepseek-v4-pro; use Codex client ≥ 0.144.0 (matches official minimal_client_version).

IV. Flash / Pro and Reasoning Effort After Peak Pricing
From 17 Aug 2026, the API bills peak vs off-peak. Codex sessions often burn many tool calls and long outputs, so cost control matters:
| Scenario | Suggestion |
|---|---|
| Daily edits, tests, docs, high-frequency small tasks | deepseek-v4-flash + model_reasoning_effort = "high" (default is enough) |
| Hard architecture, tough bugs, long agent chains | deepseek-v4-pro; raise to max only when needed |
| Simple classify / short answers | Try lower effort; thinking tokens bill as output |
Off-peak, caching, and which line rose ~1,100%: DeepSeek API price change. The web chat stays free; Codex spends API balance.
V. Verify It Works — and “Missing” Sessions
Codex CLI:
cdinto a project and runcodex. A banner withmodel: deepseek-v4-flash(or your pick) means it worked.ChatGPT desktop: Mac shows “Custom” in the model picker; Windows may show “Custom” or the model name.
VS Code Codex extension: shares the same config — install and go.
After switching to a third-party API, older ChatGPT-subscription sessions may disappear from the list. Codex groups history by login method; nothing is deleted. Restore the old config via the script menu to bring them back (DeepSeek sessions hide instead). Restart the client after switching.
VI. FAQ
Do I still need Moon Bridge or a local proxy?
Not for protocol translation on the official Responses path. If an old tutorial still insists on a proxy, verify the official script first.
Codex vs Claude Code vs Harness?
Want the OpenAI Codex client ecosystem → this guide. Anthropic-compatible toolchain → Claude Code. DeepSeek’s own agent runtime → Harness. They can coexist; pick by client.
Is putting the key in config.toml safe?
That is the current official pattern. Lock down file permissions and never commit keys to a public repo.
Summary
Shortest DeepSeek Codex setup: install Codex → run the official one-click script → confirm wire_api = "responses" → Flash for daily work, Pro for heavy jobs, and use peak pricing to control spend. Official docs win on fields; this page is a practical checklist.
Further reading
DeepSeek V4 Pro Team
DeepSeek V4 Pro technical team
Ready to experience DeepSeek V4?
Start chatting now and feel the power of 1M-token context.
🚀 Start ChattingFree · No sign-up required
🧭 In this series
Explore related guides and hub pages in this topic cluster.
Category hub
Tutorial →