CloudNavi
← Back to articles
DeepSeek + Codex Complete Guide 2026: One-Click Setup to Use DeepSeek in Codex CLI, ChatGPT Desktop, and VS Code
AI Agents·1 min read
#DeepSeek#Codex#OpenAI#coding agent#Responses API#setup

Summary

「What if I could use DeepSeek with Codex (OpenAI's AI coding assistant)?」

DeepSeek + Codex Complete Guide 2026: One-Click Setup to Use DeepSeek in Codex CLI, ChatGPT Desktop, and VS Code


「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 a one-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

ModelCodex supportNotes
deepseek-v4-flash✅ SupportedFastest and lowest cost. Best for agentic coding
deepseek-v4-pro🔜 Expected early Aug 2026Highest-performance model

Two setup options

MethodDifficultyRecommendation
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

  1. Select the model you want from the menu
  2. On first run, enter your API key (starts with sk-)
  3. Done!

What the script does automatically

StepContent
1. BackupSaves existing ~/.codex/config.toml to ~/.codex/backup-deepseek/ (restorable anytime)
2. Model catalogWrites DeepSeek model metadata to ~/.codex/models.json
3. config.toml editRewrites only necessary fields + adds [model_providers.deepseek]. Existing MCP servers etc. are all preserved
4. ValidateValidates config.toml / models.json syntax. Aborts without changes on failure

Setup flow diagram

DeepSeek × Codex One-Click Setup① RunSetup scriptbash / PowerShell② SelectChoose model from menudeepseek-v4-flash③ API keyEnter sk-...Get it at DeepSeek Platform④ Done!Backup → catalog→ config edit → validateConfigure once — works in all 3 clients!Codex CLI / ChatGPT Desktop / VS Code ExtensionRe-run to switch models or restore the original config (menu option 3)Existing MCP servers and project trust settings are all preserved

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

FieldDescription
modelDefault model to use
model_providerProvider ID (must match [model_providers.<id>])
model_catalog_jsonPath to the custom model catalog (models.json)
base_urlDeepSeek API endpoint
wire_apiProtocol; "responses" = Responses API
experimental_bearer_tokenYour 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 Custom or DeepSeek-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