Skip to content

Codex Integration Guide

Codex is an AI programming assistant from OpenAI that runs in the terminal. It interacts through natural language commands, helping developers quickly complete tasks such as code generation, debugging, and refactoring.

1. Obtain API Key

2. Install Codex

Prerequisite: Node.js 18.0 or higher version

1: Install Codex

Note: You must install the specified version 0.80.0

bash
npm install -g @openai/codex@0.80.0

2: Verify Installation

bash
codex --version

Install

3. Configure Access Credentials

The configuration file path depends on the operating system. Please ensure the path is correct, otherwise the configuration will not take effect.

1: Create Configuration File

  • macOS / Linux: ~/.codex/config.toml
  • Windows: C:\Users\YourUsername\.codex\config.toml

Copy the following content into the configuration file, replacing <OPENAI_API_MODEL> with your activated model name:

Note: env_key does not need to be modified

toml
model_provider = "EazyDevelop"
model = "<OPENAI_API_MODEL>"
[model_providers.EazyDevelop]
name = "EazyDevelop"
base_url = "https://api-maas.eazytec-cloud.com/v1"
env_key = "EAZYDEVELOP_API_KEY"
wire_api = "chat"

2: Configure Environment Variables

Replace <OPENAI_API_KEY> with the API key from EazyDevelop.

macOS / Linux:

  1. Run the following command in the terminal to check the default Shell type:

    bash
    echo $SHELL
  2. Set the environment variable based on your Shell type:

    Shell TypeCommand
    Zshecho 'export EAZYDEVELOP_API_KEY="<OPENAI_API_KEY>"' >> ~/.zshrc
    Bashecho 'export EAZYDEVELOP_API_KEY="<OPENAI_API_KEY>"' >> ~/.bashrc
  3. Run the following command to apply the environment variable:

    Shell TypeCommand
    Zshsource ~/.zshrc
    Bashsource ~/.bashrc

Windows:

Open CMD and run the following command:

Replace <OPENAI_API_KEY> with your API key

cmd
setx EAZYDEVELOP_API_KEY "<OPENAI_API_KEY>"

Verify that the environment variable is set:

cmd
echo %EAZYDEVELOP_API_KEY%

Configuration

4. Start Using

After completing the configuration, open a new terminal window and run the following command to start Codex:

bash
codex

Please ignore the red warning

Conversation

Notes

  • You must install the specified version 0.80.0; other versions may not work properly
  • Do not make mistakes with the configuration file path. You can check the home directory path using echo $HOME (macOS/Linux)
  • After setting environment variables on Windows, you need to reopen the terminal window for them to take effect
  • The env_key in config.toml does not need to be modified; keep it as EAZYDEVELOP_API_KEY