
Summary
In 2026, that dream became reality. The DeepSeek API natively supports Codex's Responses API, and with aone-click setup script, you can use DeepSeek models across Codex CLI, the ChatGPT desktop app, and the VS Code extension — all at once.
DeepSeek + Codex Complete Guide 2026: One-Click Setup to Use DeepSeek in Codex CLI, ChatGPT Desktop, and VS Code
"Want to use the powerful DeepSeek models inside Codex CLI, ChatGPT desktop, and VS Code but the setup seems fiddly?"
「What if I could use DeepSeek with Codex (OpenAI's AI coding assistant)?」
In 2026, that dream became reality. The DeepSeek API natively supports Codex's Responses API, and with aone-click setup script, you can use DeepSeek models across Codex CLI, the ChatGPT desktop app, and the VS Code extension — all at once.
This article explains the DeepSeek official docs (api-docs.deepseek.com) in a beginner-friendly, visual way.
What you'll learn in this article
- The basics of DeepSeek × Codex integration (what it can do)
- Supported models (deepseek-v4-flash)
- One-click setup (recommended) steps
- Manual configuration (config.toml / models.json)
- How to use it in Codex CLI, ChatGPT desktop, and VS Code
- Session history caveats
Bottom line: what can you do?
You can swap the model in Codex (OpenAI's AI coding assistant) to DeepSeek.
- Codex CLI, ChatGPT desktop app, and VS Code extension share the same config file
- Configure once, and DeepSeek works in all three
- Currently supported: deepseek-v4-flash (deepseek-v4-pro expected in early August 2026)
- With an API key, no ChatGPT account is needed
Supported models
| Model | Codex support | Notes |
|---|---|---|
| deepseek-v4-flash | ✅ Supported | Fastest and lowest cost. Best for agentic coding |
| deepseek-v4-pro | 🔜 Expected early Aug 2026 | Highest-performance model |
Two setup options
| Method | Difficulty | Recommendation |
|---|---|---|
| Option 1: One-click setup script | ★☆☆ (easy) | ✅ Recommended |
| Option 2: Edit config files manually | ★★☆ (intermediate) | For fine-grained control |
Option 1: One-click setup (recommended)
Prerequisites
Install Codex CLI or the ChatGPT desktop app and launch it at least once (so the ~/.codex directory is created).
Steps
macOS / Linux (run in terminal):
bash <(curl -fsSL https://cdn.deepseek.com/api-docs/codex-deepseek-setup-en.sh)
Windows (run in PowerShell):
irm https://cdn.deepseek.com/api-docs/codex-deepseek-setup-en.ps1 | iex
After running
- Select the model you want from the menu
- On first run, enter your API key (starts with
sk-)- Get one at DeepSeek Platform
- Done!
What the script does automatically
| Step | Content |
|---|---|
| 1. Backup | Saves existing ~/.codex/config.toml to ~/.codex/backup-deepseek/ (restorable anytime) |
| 2. Model catalog | Writes DeepSeek model metadata to ~/.codex/models.json |
| 3. config.toml edit | Rewrites only necessary fields + adds [model_providers.deepseek]. Existing MCP servers etc. are all preserved |
| 4. Validate | Validates config.toml / models.json syntax. Aborts without changes on failure |
Setup flow diagram
Option 2: Manual config file editing
1. Create the model catalog
Create ~/.codex/models.json (declares DeepSeek model metadata, including both deepseek-v4-flash and deepseek-v4-pro):
{
"models": [
{
"slug": "deepseek-v4-flash",
"context_window": 1048576,
"max_context_window": 1048576,
"effective_context_window_percent": 95,
"display_name": "DeepSeek-V4-Flash",
"default_reasoning_level": "high",
"supported_reasoning_levels": [
{ "effort": "low", "description": "Fast responses with lighter reasoning" },
{ "effort": "high", "description": "Extra high reasoning depth for complex problems" },
{ "effort": "max", "description": "Maximum reasoning depth for the hardest problems" }
]
}
]
}
2. Edit config.toml
Add the following to ~/.codex/config.toml:
model = "deepseek-v4-flash"
model_provider = "deepseek"
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>"
config.toml field reference
| Field | Description |
|---|---|
| model | Default model to use |
| model_provider | Provider ID (must match [model_providers. |
| model_catalog_json | Path to the custom model catalog (models.json) |
| base_url | DeepSeek API endpoint |
| wire_api | Protocol; "responses" = Responses API |
| experimental_bearer_token | Your API key (stored directly in the config file) |
Getting started
Once configured, DeepSeek works in all three clients.
Codex CLI
cd /path/to/my-project
codex
If the startup banner shows model: deepseek-v4-flash, the configuration is active!
ChatGPT desktop app
- Mac: the model picker shows Custom (the DeepSeek model you selected is actually in use)
- Windows: shows CustomorDeepSeek-V4-Flash
Codex IDE extension (VS Code)
Shares the same config as Codex CLI. Just install the extension and start using it.
Session history caveat
If previous sessions seem missing after switching providers, nothing is deleted.
- Codex stores session history in separate groups by login method
- Official ChatGPT subscription sessions and third-party API (DeepSeek) sessions are kept apart
- Only the group matching the current config is shown
- Restoring the previous config brings earlier sessions back
- Restart the ChatGPT client after switching for the change to take effect
Summary
DeepSeek × Codex integration lets you do cutting-edge agentic coding at low cost without relying on expensive ChatGPT subscriptions.
- One-click script sets everything up (with backup and validation)
- Works in Codex CLI / ChatGPT desktop / VS Code extension
- Supported model: deepseek-v4-flash (pro coming early August)
- Session history is safely kept separate
Run the one-click script and try DeepSeek models in Codex today.
👉 Official docs: DeepSeek API Docs — Integrate with Codex 👉 Get an API key: DeepSeek Platform
Related articles
- DeepSeek V4 Flash API Complete Guide 2026
- DS4Flash Local Guide 2026
- AI Model API Pricing Comparison 2026
- AI Coding Agent Comparison 2026
- pxpipe Complete Guide 2026
Related reading
- DeepSeek Harness Explained 2026: What It Can Do, How It Differs from Codex & Claude Code, and the Best Way to Use It
- DeepSeek Harness Desktop Complete Guide 2026: The Command-Free Desktop App for the Official AI Agent, Fully Explained
- Codex First Customer Finder Skill Complete Guide — The God-Tier Tool for Startups Finding Their First Customer (Japan Market Customization Included)
Share this article
Related articles

Aug 25, 2026
OpenAI "Reset Lord" Tibo Interview Explained 2026: Codex Lead on Astra, AI Culture & the Future of Agents

Aug 12, 2026
Learn Harness Engineering Complete Guide 2026: The Free Course That Makes AI Agents Reliable with a "Harness"

Aug 10, 2026
Complete Guide: OpenAI GPT-5.6-Cyber in 2026 — The Cybersecurity Model That Finds Zero-Day Vulnerabilities, Plus How to Apply

Aug 1, 2026
BREAKING (July 31, 2026): DeepSeek V4 Flash Official API Goes Public Beta! Agent Performance Surpasses V4 Pro Preview — Native Support for 6 Tools

Jul 30, 2026
Perplexity Numbat Complete Guide 2026: The Open-Source Security Layer That Visualizes & Blocks AI Agent Actions

Aug 11, 2026
Unsloth Desktop Complete Guide 2026: The First Desktop App to Run and Train Models Locally