Skip to main content
CodeX

Preparation

CodeX billing method is synchronized with official. For price ratio, please refer to Models & Pricing

Process

1

Step 1 - Install Node.js

step-1

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

step-2

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]

step-3

Edit Configuration File

Then use your operating system to enter the ~/.codex path, use vim or other tools to create or edit the config.toml file, and add the following configuration:
config.toml
model_provider = "liao"

[model_providers.liao]
name = "liao"
base_url = "https://cc.liaobots.work/codex/v1"
env_key = "OPENAI_API_KEY"
wire_api = "responses"
request_max_retries = 4
stream_max_retries = 5
stream_idle_timeout_ms = 300000
Then create an auth.json file in the ~/.codex path with the following content:
{
  "OPENAI_API_KEY": "Your Login Code"
}
4

Step 3 - Method B: Configure Environment Variables (Choose either Method A or B)

Edit Configuration File

Configure temporary or permanent environment variables OPENAI_API_KEY and OPENAI_BASE_URL for your command lineMac / Linux:
export OPENAI_API_KEY=Your Login Code
export OPENAI_BASE_URL=https://cc.liaobots.work/codex/v1
Windows:
set OPENAI_API_KEY=Your Login Code
set OPENAI_BASE_URL=https://cc.liaobots.work/codex/v1
The above examples are temporary environment variables. If you need to modify permanent environment variables, please find tutorials yourself
5

Step 4 Start Using

step-4

Start Using

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