CodeX Deployment Guide
Enterprise-grade AI coding assistant deployment guide.
Prerequisite
Complete Node.js installation and CC-Switch installation first.
Quick Navigation
CodeX is a next-generation intelligent coding assistant based on GPT-5 architecture, providing strong code generation and optimization capabilities.
Deployment path: system environment setup -> CLI installation -> API integration -> development environment ready
Configure Quickly with CC-Switch (Recommended)
Prerequisite
Before configuring CodeX with CC-Switch, make sure CodeX is installed globally with npm:
npm install -g @openai/codex@latestVerify installation with codex --version.
Using CC-Switch is recommended for graphical configuration without manual command-line work.
Configuration Steps
1. Start CC-Switch and switch to the Codex tab
- Open CC-Switch
- Click the Codex tab
- Click the orange + button in the upper-right corner
2. Fill in CodeX provider settings
- Provider name: custom name, such as
Xiaomai API - Base URL:
https://xiaomai.win/v1 - API Key: paste your CodeX-specific token from Xiaomai API, using the
codex测试token group - Model: choose
gpt-5-codex - Other settings: adjust reasoning effort, network access, and other parameters as needed
- Click Save
Tip
- CC-Switch automatically creates
~/.codex/config.tomlandauth.json - You can add multiple provider configurations and switch anytime
- Restart CodeX after switching configuration
3. Enable the configuration
- Find the Xiaomai API configuration in the list
- Click Use Current
- The configuration is marked as current with a green label
- Restart CodeX
4. Quick switching from the system tray
- Right-click the CC-Switch tray icon
- Choose the Codex category
- Select the target configuration
- The configuration is applied without opening the main window
Notes
- Create the dedicated key from the
codex测试token group - CodeX tokens and Claude Code tokens are not interchangeable
- Restart CodeX after switching configuration
- Endpoint speed can be tested in CC-Switch
Manual Command-Line Configuration
If you do not use CC-Switch, configure CodeX manually.
Windows
Step 1: Install the CodeX CLI
Start Command Prompt or PowerShell as administrator and run:
npm install -g @openai/codex@latest
codex --versionStep 2: Integrate Xiaomai API
Get API credentials:
- Open the Xiaomai API developer console
- Register or sign in
- Go to API key management
- When creating a key, choose the
codex测试token group - Save the generated API key securely
Security
CodeX requires its own token group and is fully separated from the Claude Code token system.
Create the configuration directory:
mkdir "$env:USERPROFILE\.codex"
cd "$env:USERPROFILE\.codex"Create config.toml:
model_provider = "xiaomai"
model = "gpt-5.2-codex"
model_reasoning_effort = "xhigh"
network_access = "enabled"
disable_response_storage = true
approval_policy = "on-request"
web_search = "live"
sandbox_mode = "danger-full-access"
collaboration_mode = true
model_supports_reasoning_summaries = true
[model_providers.xiaomai]
name = "Xiaomai API"
base_url = "https://xiaomai.win/v1"
wire_api = "responses"
requires_openai_auth = true
[features]
shell_snapshot = true
collab = false
collaboration_modes = false
steer = false
unified_exec = falseCreate auth.json:
{
"OPENAI_API_KEY": "paste your CodeX-specific token here"
}Step 3: Initialize a Workspace
mkdir my-codex-project
cd my-codex-project
codexmacOS
Install CodeX
npm install -g @openai/codex@latest
codex --versionIntegrate API Service
Create configuration directory:
mkdir -p ~/.codex
cd ~/.codexCreate config.toml:
cat > config.toml << 'EOF'
model_provider = "xiaomai"
model = "gpt-5.2-codex"
model_reasoning_effort = "xhigh"
network_access = "enabled"
disable_response_storage = true
approval_policy = "on-request"
web_search = "live"
sandbox_mode = "danger-full-access"
collaboration_mode = true
model_supports_reasoning_summaries = true
[model_providers.xiaomai]
name = "Xiaomai API"
base_url = "https://xiaomai.win/v1"
wire_api = "responses"
requires_openai_auth = true
[features]
shell_snapshot = true
collab = false
collaboration_modes = false
steer = false
unified_exec = false
EOFCreate auth.json:
cat > auth.json << 'EOF'
{
"OPENAI_API_KEY": "paste your CodeX-specific token here"
}
EOFInitialize a Workspace
mkdir my-codex-project
cd my-codex-project
codexLinux
Install CodeX
sudo npm install -g @openai/codex@latest
codex --versionIntegrate API Service
Create configuration directory:
mkdir -p ~/.codex
cd ~/.codexCreate config.toml:
cat > config.toml << 'EOF'
model_provider = "xiaomai"
model = "gpt-5.2-codex"
model_reasoning_effort = "xhigh"
network_access = "enabled"
disable_response_storage = true
approval_policy = "on-request"
web_search = "live"
sandbox_mode = "danger-full-access"
collaboration_mode = true
model_supports_reasoning_summaries = true
[model_providers.xiaomai]
name = "Xiaomai API"
base_url = "https://xiaomai.win/v1"
wire_api = "responses"
requires_openai_auth = true
[features]
shell_snapshot = true
collab = false
collaboration_modes = false
steer = false
unified_exec = false
EOFCreate auth.json:
cat > auth.json << 'EOF'
{
"OPENAI_API_KEY": "paste your CodeX-specific token here"
}
EOFInitialize a Workspace
mkdir my-codex-project
cd my-codex-project
codexFAQ
Are CodeX and Claude Code tokens interchangeable?
No. They use different token groups:
- Claude Code: Claude Code token group
- CodeX:
codex测试token group
Create the corresponding dedicated token on the Xiaomai API platform.
Where are configuration files stored?
- Windows:
%USERPROFILE%\.codex\ - macOS/Linux:
~/.codex/