Menu

Codex Installation and Configuration Tutorial

Windows Version Tutorial

System Requirements

Windows 10 or Windows 11
Node.js 22+
npm 10+
Network Connection

Installation Steps Installation Steps

Preparatory Steps!!!
Install Git Bash by visiting Git - Downloads Download the version that corresponds to your computer system, and then just keep clicking “Next” to complete the installation.1. Install Node.js
Access Node.js Official Website Download and install the latest LTS version.2. Install the Codex
Open the Command Prompt (CMD) or PowerShell and run:
npm install -g @openai/codex
3. Verification of Installation 3. Verify the installation process.
Open the Command Prompt (CMD) or PowerShell and run:
codex --version

Configure API

1. Obtain the Auth Token
Access api.airai.cc Perform the following operations on the site page:
Click Console → API Token Page
Click Add tokens Add tokens
Token grouping options: Please select the token grouping:Codex-exclusive(You must select this group; otherwise, it cannot be used.)
Token name: arbitrary Token name: arbitrary
Quota Recommendation: Set it to Unlimited quota
Other options remain default.
image.png2. Configuration Files
Important NoticePlease replace the sk-xxx below with the actual API key you generated from api.airai.cc!
Important NoticePlease replace the sk-xxx below with the actual API key you generated from api.airai.cc!
Important NoticePlease replace the sk-xxx below with the actual API key you generated from api.airai.cc!
1.
Enter the .codex folder within the user directory of the current user, for example: C:\Users\testuser\.codex.
(NoteIf you cannot see that directory, it means you have not turned on the "Show hidden items" option in Windows. Please enable this option in File Explorer first.
image.png
2.
If the .codex folder does not exist, please create it manually, and then create two files within it: config.toml and auth.json.
image.png
3. Fill in the configuration (You need to replace sk-xxx with the actual SK you have created).The configuration in `auth.json`:
{"OPENAI_API_KEY": "sk-xxx"}
b. The configuration in config.toml (you can just paste the following content directly):
The optional values for model_reasoning_effort are high, medium, and low, which represent the degree of effort in the model's thinking (high, medium, low) respectively.
model_provider = "api111"
model = "gpt-5-codex"
model_reasoning_effort = "high"
disable_response_storage = true
preferred_auth_method = "apikey"

[model_providers.api111]
name = "api111"
base_url = "https://api.airai.cc/v1"
wire_api = "responses"

Start the Codex

Restart the terminal! Restart the terminal! Restart the terminal!
Then navigate to your project directory:
cd your-project-folder
Run the following command to start:
codex
image.png

VSCode Plugin Codex

After completing the above configuration, you can search for and install the codex extension in the VSCode extension store.image.png
It will appear in the sidebar after the installation is complete.

image.png

Mac Version Tutorial

System Requirements

macOS 12 or later versions
Node.js 22+
npm 10+
Network Connection

Installation Steps Installation Steps

1. Install Node.js
Method OneDirect access Node.js Official Website Download and install the latest LTS version.
Method Two Method TwoUse Homebrew (recommended)
# 如果尚未安装 Homebrew,请先运行此命令/bin/bash -c "$(curl -fsSL [https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh](https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh))"# 安装 Node.jsbrew install node
2. Install the Codex
Open the Terminal and run the following command (you may need to add `sudo` at the end):
npm install -g @openai/codex
3. Verification of Installation 3. Verify the installation process.
Open the Terminal and run:
codex --version

Configure API

1. Obtain the Auth Token
Access api.airai.cc Perform the following operations on the site page:
Click Console → API Token Page
Click Add tokens Add tokens
Token grouping options: Please select the token grouping:Codex Exclusive(You must select this group; otherwise, it cannot be used.)
Token name: arbitrary Token name: arbitrary
Quota Recommendation: Set it to Unlimited quota
Other options remain default.
image.png
2. Configuration Files
Important NoticePlease replace the sk-xxx below with the actual API key you generated from api.airai.cc!
Important NoticePlease replace the sk-xxx below with the actual API key you generated from api.airai.cc!
Important NoticePlease replace the sk-xxx below with the actual API key you generated from api.airai.cc!
1.
Create directories and files:
mkdir -p ~/.codextouch ~/.codex/auth.jsontouch ~/.codex/config.toml
2.
Edit the auth.json file:
vi ~/.codex/auth.json
Enter insert mode by pressing i, paste the following content (replace sk-xxx with your own key), then press ESC, enter :wq, and press Enter to save and exit.
{"OPENAI_API_KEY": "sk-xxx"}
3.
Edit the config.toml file:
vi ~/.codex/config.toml
Enter insert mode by pressing i, paste the following content, then press ESC, enter :wq, and press Enter to save and exit.
model_provider = "api111"
model = "gpt-5-codex"
model_reasoning_effort = "high"
disable_response_storage = true
preferred_auth_method = "apikey"

[model_providers.api111]
name = "api111"
base_url = "https://api.airai.cc/v1"
wire_api = "responses"

Start the Codex

Restart the terminal! Restart the terminal! Restart the terminal!
Then navigate to your project directory:
cd your-project-folder
Run the following command to start:
codex
[Image]

VSCode Plugin Codex

After completing the above configuration, simply search for and install the codex extension in the VSCode extension store.
[Image]It will appear in the sidebar after the installation is complete.
[Image]

Linux Version Tutorial

System Requirements

Mainstream Linux distributions (Ubuntu 20.04+, Debian 10+, CentOS 7+, etc.)
Node.js 22+
npm 10+
Network Connection

Installation Steps Installation Steps

1. Install Node.js
Ubuntu/Debian
sudo apt update
curl -fsSL https://deb.nodesource.com/setup_lts.x  | 
sudo -E bash -sudo apt-get install -y nodejs
CentOS/RHEL/Fedora
# 使用 dnf (Fedora) 或 yum (CentOS/RHEL)sudo dnf install nodejs npm# 或sudo yum install nodejs npm
Arch Linux
sudo pacman -S nodejs npm
2. Install the Codex
Open the Terminal and run:
sudo npm install -g @openai/codex
3. Verification of Installation 3. Verify the installation process.
Open the Terminal and run:
codex --version

Configure API

1. Obtain the Auth Token
Access api.airai.cc Perform the following operations on the site page:
Click Console → API Token Page
Click Add tokens Add tokens
Token grouping options: Please select the token grouping:codex channel-gpt(You must select this group; otherwise, it cannot be used.)
Token name: arbitrary Token name: arbitrary
Quota Recommendation: Set it to Unlimited quota
Other options remain default.
[Image]
2. Configuration Files
Important NoticePlease replace the sk-xxx below with the actual API key you generated from api.airai.cc!
Important NoticePlease replace the sk-xxx below with the actual API key you generated from api.airai.cc!
Important NoticePlease replace the sk-xxx below with the actual API key you generated from api.airai.cc!
1.
Create directories and files:
mkdir -p ~/.codextouch ~/.codex/auth.jsontouch ~/.codex/config.toml
2.
Edit the auth.json file:
vi ~/.codex/auth.json
Enter insert mode using i, paste the following content (replace sk-xxx with your own key), then press ESC, enter :wq, and press Enter to save and exit.
{"OPENAI_API_KEY": "sk-xxx"}
3.
Edit the config.toml file:
vi ~/.codex/config.toml
Enter insert mode by pressing i, paste the following content, then press ESC, enter :wq, and press Enter to save and exit.
model_provider = "api111"
model = "gpt-5-codex"
model_reasoning_effort = "high"
disable_response_storage = true
preferred_auth_method = "apikey"

[model_providers.api111]
name = "api111"
base_url = "https://api.airai.cc/v1"
wire_api = "responses"

Start the Codex

Restart the terminal! Restart the terminal! Restart the terminal!
Then navigate to your project directory:
cd your-project-folder
Run the following command to start:
codex
image.png

VSCode Plugin Codex

After completing the above configuration, you can search for and install the codex extension in the VSCode extension store.image.png
It will appear in the sidebar after the installation is complete.

image.png

Frequently Asked Questions

If an error occurs, please follow the steps below to troubleshoot:
1.
Confirm whether the API Key has been created correctly: Select the appropriate quota.Unlimited quotaDo not limit the model; use grouping to make selections. codex channel-gpt。
For more details on Codex configuration and usage, please refer to Codex Official Tutorial。


Was this helpful?

Technical SupportLive Support
Back to Top
简体中文ZH-CNDefault繁體中文ZH-TWEnglishEN日本語JA한국어KOภาษาไทยTHTiếng ViệtVIBahasa IndonesiaIDEspañolESFrançaisFRDeutschDEРусскийRUPortuguêsPTItalianoITالعربيةAR