DeepSeek now provides a Responses API route designed for Codex. The current setup is more than a base URL change. Codex also needs a model catalog so it knows the model’s context limit, reasoning settings, and tool behavior.
The configuration is shared by Codex CLI, the Codex IDE extension, and the ChatGPT desktop app. Back up your existing Codex files before changing the provider.
What changed from older guides
Older examples commonly used deepseek-chat, deepseek-reasoner, and wire_api = "chat". DeepSeek discontinued those model aliases on July 24, 2026. Its current Codex documentation uses:
Current Codex settings
| Model | deepseek-v4-flash |
|---|---|
| Base URL | https://api.deepseek.com/ |
| Protocol | wire_api = responses |
| Model catalog | ~/.codex/models.json |
DeepSeek’s general API supports V4 Flash and V4 Pro, but the Responses API documentation currently lists V4 Flash for Codex. Verify the integration page before changing the Codex model to V4 Pro.
Back up the current Codex configuration
Codex stores its main configuration under ~/.codex. In PowerShell, that normally resolves to C:\Users\YourName\.codex. In WSL, it is inside your Linux home.
Make a copy of these files if they already exist:
~/.codex/config.toml
~/.codex/models.json
Choose automatic or manual setup
DeepSeek publishes setup scripts for PowerShell and Unix shells. Those scripts back up the existing Codex configuration, write the model catalog, update the provider, and validate the files.
Review any downloaded script before executing it. If you do not want a script to modify your Codex files, follow DeepSeek’s manual instructions instead. The manual route requires copying the current models.json content from the official integration page because the catalog contains more than a model name.
Configure config.toml
After creating the current models.json from DeepSeek’s documentation, add the provider to ~/.codex/config.toml:
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>"
The official configuration currently places the token directly in config.toml. Restrict access to the .codex directory and do not commit this file to a repository.
Test the provider
Open a new terminal in a small test repository:
cd /path/to/test-project
codex
Check the startup banner. It should show deepseek-v4-flash. Give Codex a read-only task first, such as summarizing a short file. Then inspect your DeepSeek usage records to confirm that the request reached the intended account.
If Codex asks for ChatGPT authentication or displays an OpenAI model, recheck preferred_auth_method, forced_login_method, model_provider, and the path to models.json.
Common problems
- A model catalog error usually means
models.jsonis missing, invalid, or saved at a different path. - A 401 response means the DeepSeek key is missing, malformed, or no longer valid.
- A model-not-found response usually means an old alias remains in
config.tomlor the model catalog. - Protocol errors often come from
wire_api = "chat". The current Codex integration usesresponses. - Existing MCP or trust settings disappeared because the configuration was replaced instead of merged. Restore the backup and add only the provider fields.
DeepSeek Codex checklist
- Existing config.toml and models.json backed up
- Current models.json copied from DeepSeek's Codex integration page
- deepseek-v4-flash selected
- wire_api set to responses
- Codex startup banner checked
- Test request confirmed in DeepSeek usage records
Treat the official DeepSeek integration page as the source for the model catalog. The catalog can change when Codex adds new capabilities or DeepSeek expands Responses API support.