
Preparation
CodeX billing method is synchronized with official. For price ratio, please refer to Models & PricingProcess
1
Step 1 - Install Node.js

Verify Node.js Installation
Open terminal and enter
node --version and npm --version to verify Node.js installation
If you see a version number like v22.16.0, proceed to the next step. Otherwise, please download from the official website https://nodejs.org/en/download/2
Step 2 - Install CodeX

Install CodeX
Open terminal and enter
npm i -g @openai/codex to install CodeX globally
After successful installation, use the codex command in the target folder path (such as the folder where you will create/modify code)
As shown in the image, installation is successful (this is just to check if installation is successful, no interaction is needed, just use Ctrl+C to exit after successful startup)3
Step 3 - Method A: Modify Configuration File for Persistence [Recommended]

Edit Configuration File
Then use your operating system to enter the Then create an
~/.codex path, use vim or other tools to create or edit the config.toml file, and add the following configuration:config.toml
auth.json file in the ~/.codex path with the following content:4
Step 3 - Method B: Configure Environment Variables (Choose either Method A or B)
Edit Configuration File
Configure temporary or permanent environment variables Windows:The above examples are temporary environment variables. If you need to modify permanent environment variables, please find tutorials yourself
OPENAI_API_KEY and OPENAI_BASE_URL for your command lineMac / Linux:5
Step 4 Start Using

Start Using
Use the cd command to enter the project folder you want to edit, enter
codex, and then you can start using CodeX