TLDR
- API Shift : Codexv0.80.0+ requires Responses API; Chat Completions API is deprecated.
x codexQuick Run : Runx codex <provider>(e.g.,x codex deepseek) for temporary sessions without touching global configs.- Global Config : Manual editing works but is tedious and easy to overwrite.
- GUI Management : Use
x install cc-switchfor visual API and MCP switching. - Rollback : Use
x env use codex=v0.80.0if legacy Chat Completions API is needed.
Starting from Codex v0.80.0+, Codex uses the Responses API as its sole inference interface and no longer supports the Chat Completions API.
By default, Codex uses OpenAI's ChatGPT series models. For users in mainland China, accessing ChatGPT may involve network or account restrictions.
If you want to use other models within Codex, consider the following connection methods.
Switch to third-party models with a single command without modifying global configs #
x-cmd provides a lightweight connection method.
Taking DeepSeek as an example, by directly running x codex deepseek, x-cmd injects the necessary DeepSeek configuration into Codex. These configurations only affect the current Codex process and will not modify your original global settings.
Running x codex normally continues to use your original OpenAI configuration; when you need DeepSeek, simply run x codex deepseek. Both environments can coexist, and after exiting the DeepSeek session, original files like config.toml and models.json remain untouched.
Currently, providers like GLM and MiniMax can also be accessed in the same way. Specific configurations are handled by x-cmd, so users don't need to fill out a bunch of settings themselves.
Modify global configurations directly #
You can also manually edit Codex's global configuration files to insert the API and model details for third-party models.
This approach requires finding the corresponding configuration items and modifying files yourself. Switching models requires editing again, and improper modifications might overwrite existing settings, affecting your previous Codex environment.
In the future, x-cmd may wrap these operations into commands like x codex use deepseek, completing configuration switches via dedicated TOML modification tools.
Third-party GUI tools #
If you don't want to edit configuration files manually, you can use third-party GUI tools.
Taking CC-Switch as an example, it is a cross-platform desktop application built with Rust + Tauri. It can manage API configurations, MCP Servers, and Skills for Agents like Codex, Claude Code, OpenCode, OpenClaw, and Hermes Agent.
Installation can be done directly with:
x install cc-switch
Then, complete the relevant configurations and switches through the graphical user interface.
Version rollback #
Starting from Codex v0.80.0+, only the Responses API is supported. If your existing third-party model setup relies on the Chat Completions API, you can roll back to an older Codex version to maintain compatibility:
x env use codex=v0.80.0
This method is primarily suitable for scenarios where compatibility with the older interface is required.
Conclusion #
If you frequently switch between OpenAI and other models, you can choose a configuration method based on your habits. You can also try x codex to launch other models independently without altering your original global configuration.
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~