The official Responses API configuration lets Codex CLI, the ChatGPT desktop app, and the VS Code Codex extension share a single DeepSeek-V4-Flash configuration, making it suitable for migrating the same code Agent workflow to DeepSeek.
Suitable tasks: Modifying codebases with an existing Codex workflow, running tests, calling tools, and carrying out long-running Agent tasks.
Unsuitable tasks: Teams that do not want to place an API key directly in the local Codex configuration, or that depend on a ChatGPT account login session; evaluate a key-management approach first.
Supported model version: deepseek-v4-flash.
Supported clients, Agent, or API: Codex CLI, ChatGPT desktop app, and VS Code Codex IDE extension; all three read the same configuration.
Recommended reasoning level and parameters: The official manual configuration example uses model_reasoning_effort = "high"; for simple tasks, switch to low according to the thinking-mode documentation, and for complex tasks, use max.
Make sure Codex CLI or the ChatGPT desktop app has been launched at least once, then run the official script for your operating system. The script backs up the existing config.toml, writes models.json, preserves MCP and project trust settings, and validates the TOML/JSON before writing it back:
# macOS / Linux
bash <(curl -fsSL https://cdn.deepseek.com/api-docs/codex-deepseek-setup-en.sh)
# Windows PowerShell
irm https://cdn.deepseek.com/api-docs/codex-deepseek-setup-en.ps1 | iex~/.codex/config.toml snippet for manual configurationmodel = "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 models.json mentioned above is not reconstructed in this article. Have the official script generate it directly, or expand the complete content from the official documentation and save it; do not guess the model-catalog metadata from this snippet.
Back up the existing ~/.codex/config.toml and MCP configuration; the official script places backups in ~/.codex/backup-deepseek/, and you should also make a backup before configuring manually.
Run the one-click script and select deepseek-v4-flash from the menu, or manually write the provider configuration above.
Use the official script to generate ~/.codex/models.json; do not delete existing project trust settings or MCP servers.
Run codex from the project directory; the startup banner should show model: deepseek-v4-flash.
Validate the Responses API, tool calls, test execution, and result delivery with one read-only task and one small, reversible change before migrating to a production codebase.
If you cannot find historical sessions after switching, restart the client; according to the official documentation, ChatGPT login sessions and third-party API sessions are saved in separate groups by authentication method rather than being deleted.
The official documentation states that DeepSeek natively supports the OpenAI Responses API, and that Codex CLI, the ChatGPT desktop app, and the VS Code extension share the same configuration file.
Official example fields include model="deepseek-v4-flash", model_provider="deepseek", wire_api="responses", base_url="https://api.deepseek.com/", and model_reasoning_effort="high".
Verifiable behavior of the official one-click script: backs up the existing configuration; writes models.json; rewrites only the necessary config.toml fields; preserves MCP servers and project trust levels; validates TOML/JSON before writing; and offers menu options to switch models or restore the original configuration.
The official update page says that 0731 V4-Flash natively supports the Responses API and is “specifically adapted for Codex”.
This is a configuration and integration guide, not an independent benchmark; the startup banner can show that the configuration is active, but cannot demonstrate task quality.
experimental_bearer_token places the API key in the configuration file; production environments should restrict file permissions or use a team-approved secret-injection method instead.
The official documentation requires Codex CLI/the desktop app to have been launched previously to create ~/.codex; without that directory, the one-click script's prerequisite is not met.
This article does not reconstruct the complete official models.json; metadata such as the context window and tool formats should follow the script or the expanded official content.
The official documentation describes the three types of clients as sharing “the same configuration file” and uses wire_api = "responses" as the protocol field for the DeepSeek provider.
DeepSeek V4 Flash