TLDR
- DeepSeek now supports the OpenAI Responses API, enabling direct Codex integration.
- x codex ds runs DeepSeek without modifying existing Codex configuration.
- OpenAI and DeepSeek can coexist, with API keys passed via environment variables.
Recently, DeepSeek V4 series models added support for the OpenAI Responses API, making Codex integration much more straightforward.
However, compared with DeepSeek's official integration guide, we provide a safer and more convenient approach: use DeepSeek models without modifying your existing Codex configuration.
Don't Modify the Config File #
Previously, integrating third-party models with Codex required handling the conversion between the Responses API and Chat Completions API. Now that DeepSeek natively supports the Responses API, this extra step is no longer necessary.
However, we noticed that DeepSeek's official integration guide directly modifies the global configuration file as plain text, rather than using a dedicated TOML editing tool. In highly customized setups, this approach could potentially disrupt existing configuration. Switching back to OpenAI afterward is also inconvenient. Why modify an already-configured Codex just to add another model?
After using Codex for a while, ~/.codex/config.toml
often contains many personal settings, including ** model, provider, permission policies, MCP, and hooks**.
Following the official guide can integrate DeepSeek successfully, but it changes the existing Codex environment. Switching back to OpenAI later requires editing the configuration again.
Our approach uses Codex's ** --config option** to provide the DeepSeek-specific settings as
overrides for the current launch. They
only apply to the current Codex process and do not affect the user's existing
config.toml
, models.json
, or other files.## Safe and Non-Intrusive
Your existing Codex configuration remains completely unchanged. Even if you've heavily customized Codex, you don't need to edit or overwrite configuration files just to use DeepSeek, avoiding unintended changes to other settings when switching models.
The API key can also be passed through environment variables, so it doesn't need to be stored in plain text in TOML.
Easy to Coexist #
You don't need to repeatedly edit the configuration to switch between OpenAI and DeepSeek.
When you need DeepSeek, simply run:
x codex ds
After exiting, start Codex normally, and it will still use your original OpenAI configuration.
This approach is suitable for one-off tasks or scenarios where you need to switch between different models. Update to or download the latest X-CMD
v0.10.3 to use it.
Persistent Configuration #
If you later want to use DeepSeek as your default model or sync the configuration to clients such as Codex Desktop, you will need to make the configuration persistent.
For this, we will provide an ** x codex use ds** solution in the next release, using a
dedicated TOML editing tool to switch configurations
without manually editing the configuration file.
Please indicate the source and link of this article when reprinting.
Help us make these docs great!
All X-CMD docs are generated from command help and multiple data sources. See something that's wrong or unclear? Feel free to let us know through any of these ways~