Set up and use Coding Plan with Codex.
Scope
Applies to older versions of Codex that support the Chat/Completions API, such as version 0.80.0. Newer versions of Codex use the Responses API and do not yet support the Coding Plan.
Install Codex
Install or update Node.js (v18.0 or later).
Install Codex.
NoteThe latest version of Codex does not support the Chat/Completions API. Install a compatible older version to use the Coding Plan.
npm install -g @openai/codex@0.80.0Verify the installation.
codex --version
Set up Coding Plan in Codex
Update the config file
Add the following to your Codex config file at
~/.codex/config.toml. For themodelparameter, select a supported model.NoteThe latest version of Codex does not support the Chat/Completions API. To use the Coding Plan, you must install a compatible version. See the Install Codex section.
model_provider = "Model_Studio_Coding_Plan" model = "qwen3.5-plus" [model_providers.Model_Studio_Coding_Plan] name = "Model_Studio_Coding_Plan" base_url = "https://coding-intl.dashscope.aliyuncs.com/v1" env_key = "OPENAI_API_KEY" wire_api = "chat"Set the environment variable
Set the
OPENAI_API_KEYenvironment variable to your Coding Plan API key.macOS
Check your default shell.
echo $SHELLSet the environment variable based on your shell type.
Zsh
# Replace YOUR_API_KEY with your Coding Plan API key echo 'export OPENAI_API_KEY="YOUR_API_KEY"' >> ~/.zshrcBash
# Replace YOUR_API_KEY with your Coding Plan API key echo 'export OPENAI_API_KEY="YOUR_API_KEY"' >> ~/.bash_profileApply the environment variable.
Zsh
source ~/.zshrcBash
source ~/.bash_profile
Windows
CMD
Set the environment variable in CMD.
REM Replace YOUR_API_KEY with your Coding Plan API key setx OPENAI_API_KEY "YOUR_API_KEY"Open a new CMD window and verify the environment variable.
echo %OPENAI_API_KEY%
PowerShell
Set the environment variable in PowerShell.
# Replace YOUR_API_KEY with your dedicated API key [Environment]::SetEnvironmentVariable("OPENAI_API_KEY", "YOUR_API_KEY", [EnvironmentVariableTarget]::User)Open a new PowerShell window and verify the environment variable.
echo $env:OPENAI_API_KEY
Use Codex
Open a new terminal and start Codex.
codexSkip the update prompt.

Start a conversation.

FAQ
What do I do if I get the error "wire_api = chat is no longer supported"?
Cause: Newer versions of Codex use the Responses API and do not support the wire_api = "chat" setting or the Coding Plan.
Solution: Downgrade to a compatible version:
npm install -g @openai/codex@0.80.0What do I do if I get the error "unexpected status 404 Not Found: Unknown error, url: https://coding.dashscope.aliyuncs.com/v1/responses"
Cause: The wire_api parameter in the config file is incorrectly set to responses. Codex does not support connecting to Coding Plan through the Responses API.
Solution: Set wire_api to chat.
wire_api = "chat"