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
Open the Command Prompt (CMD) or PowerShell and run:
codex --version
Configure API
1. Obtain the Auth TokenAccess 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.
Important NoticePlease replace thesk-xxxbelow with the actual API key you generated from api.airai.cc!
Important NoticePlease replace thesk-xxxbelow with the actual API key you generated from api.airai.cc!
Important NoticePlease replace thesk-xxxbelow with the actual API key you generated from api.airai.cc!
1.
Enter the
(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.
.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.
2.
If the
.codex folder does not exist, please create it manually, and then create two files within it: config.toml and auth.json.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"}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
codex
VSCode Plugin Codex
After completing the above configuration, you can search for and install thecodex extension in the VSCode extension store.It will appear in the sidebar after the installation is complete.
Mac Version Tutorial
System Requirements
macOS 12 or later versions
Node.js 22+
npm 10+
Network Connection
Installation Steps Installation Steps
1. Install Node.jsMethod 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
Open the Terminal and run the following command (you may need to add `
sudo` at the end):npm install -g @openai/codex
Open the Terminal and run:
codex --version
Configure API
1. Obtain the Auth TokenAccess 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.

Important NoticePlease replace thesk-xxxbelow with the actual API key you generated from api.airai.cc!
Important NoticePlease replace thesk-xxxbelow with the actual API key you generated from api.airai.cc!
Important NoticePlease replace thesk-xxxbelow 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 Enter insert mode by pressing
auth.json file:vi ~/.codex/auth.json
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 Enter insert mode by pressing
config.toml file:vi ~/.codex/config.toml
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
codex
VSCode Plugin Codex
After completing the above configuration, simply search for and install thecodex 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.jsUbuntu/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
Open the Terminal and run:
sudo npm install -g @openai/codex
Open the Terminal and run:
codex --version
Configure API
1. Obtain the Auth TokenAccess 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]
[Image]
Important NoticePlease replace thesk-xxxbelow with the actual API key you generated from api.airai.cc!
Important NoticePlease replace thesk-xxxbelow with the actual API key you generated from api.airai.cc!
Important NoticePlease replace thesk-xxxbelow 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 Enter insert mode using
auth.json file:vi ~/.codex/auth.json
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 Enter insert mode by pressing
config.toml file:vi ~/.codex/config.toml
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
codex
VSCode Plugin Codex
After completing the above configuration, you can search for and install thecodex extension in the VSCode extension store.It will appear in the sidebar after the installation is complete.
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。
Posted by @oneai on AIRAI. Contact us if you have questions.
Article link:https://airai.cc/en/appsetting/47/
Article link:https://airai.cc/en/appsetting/47/
Was this helpful?