All Products
Search
Document Center

Alibaba Cloud Model Studio:Codex

Last Updated:Mar 03, 2026

Codex is an intelligent coding agent developed by OpenAI. Set up and use Alibaba Cloud Model Studio's Coding Plan with Codex.

Note

The latest version of Codex no longer supports the Chat or Completions API. To use the Coding Plan, follow the instructions below to install and use an earlier version.

Install Codex

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

  2. Run the following command in your terminal to install an older version of Codex that supports the Chat and Completions APIs, such as version 0.80.0.

    npm install -g @openai/codex@0.80.0

    Verify the installation. If a version number is returned, the installation is successful.

    codex --version

Configure Codex

  1. Update the config file

    Copy the following code block and paste it into your Codex config file: ~/.codex/config.toml. Select a supported model from the list.

    Note

    The latest version of Codex no longer supports the Chat or Completions API. To use the Coding Plan, follow the instructions above to install an earlier version of Codex.

    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. Run the following command in your terminal to 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. Run the following command in CMD to set the environment variable.

      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. Run the following command in PowerShell to set the environment variable.

      # Replace YOUR_API_KEY with your Coding Plan 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