All Products
Search
Document Center

Alibaba Cloud Model Studio:Codex

Last Updated:Apr 01, 2026

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

  1. Install or update Node.js (v18.0 or later).

  2. Install Codex.

    Note

    The 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.0

    Verify the installation.

    codex --version

Set up Coding Plan in Codex

  1. Update the config file

    Add the following to your Codex config file at ~/.codex/config.toml. For the model parameter, select a supported model.

    Note

    The 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"
  2. Set the environment variable

    Set the OPENAI_API_KEY environment variable to your Coding Plan API key.

    macOS

    1. Check your default shell.

      echo $SHELL
    2. Set 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"' >> ~/.zshrc

      Bash

      # Replace YOUR_API_KEY with your Coding Plan API key
      echo 'export OPENAI_API_KEY="YOUR_API_KEY"' >> ~/.bash_profile
    3. Apply the environment variable.

      Zsh

      source ~/.zshrc

      Bash

      source ~/.bash_profile

    Windows

    CMD

    1. Set the environment variable in CMD.

      REM Replace YOUR_API_KEY with your Coding Plan API key
      setx OPENAI_API_KEY "YOUR_API_KEY"
    2. Open a new CMD window and verify the environment variable.

      echo %OPENAI_API_KEY%

    PowerShell

    1. 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)
    2. Open a new PowerShell window and verify the environment variable.

      echo $env:OPENAI_API_KEY

Use Codex

  1. Open a new terminal and start Codex.

    codex

    Skip the update prompt.

    image

  2. Start a conversation.

    image

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.0

What 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"