
Preparation
CodeX billing method is synchronized with official. For price ratio, please refer to Models & Pricing. For API addresses and backup URLs, see API Call ExamplesProcess
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/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)Step 3 - Create Configuration File
Edit Configuration File
Navigate to Then create a
~/.codex path, create or edit the config.toml file with the following configuration:config.toml
.env file in the ~/.codex path with the following content:model_context_window and model_auto_compact_token_limit are only supported with 1M context by gpt-5.4. If using other models (e.g. o3-pro), comment out these two lines or you may get errors.