Skip to content

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

Prerequisite

Before configuring CodeX with CC-Switch, make sure CodeX is installed globally with npm:

bash
npm install -g @openai/codex@latest

Verify 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

  1. Open CC-Switch
  2. Click the Codex tab
  3. Click the orange + button in the upper-right corner

2. Fill in CodeX provider settings

  1. Provider name: custom name, such as Xiaomai API
  2. Base URL: https://xiaomai.win/v1
  3. API Key: paste your CodeX-specific token from Xiaomai API, using the codex测试 token group
  4. Model: choose gpt-5-codex
  5. Other settings: adjust reasoning effort, network access, and other parameters as needed
  6. Click Save

Tip

  • CC-Switch automatically creates ~/.codex/config.toml and auth.json
  • You can add multiple provider configurations and switch anytime
  • Restart CodeX after switching configuration

3. Enable the configuration

  1. Find the Xiaomai API configuration in the list
  2. Click Use Current
  3. The configuration is marked as current with a green label
  4. 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:

powershell
npm install -g @openai/codex@latest
codex --version

Step 2: Integrate Xiaomai API

Get API credentials:

  1. Open the Xiaomai API developer console
  2. Register or sign in
  3. Go to API key management
  4. When creating a key, choose the codex测试 token group
  5. 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:

powershell
mkdir "$env:USERPROFILE\.codex"
cd "$env:USERPROFILE\.codex"

Create config.toml:

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 = false

Create auth.json:

json
{
  "OPENAI_API_KEY": "paste your CodeX-specific token here"
}

Step 3: Initialize a Workspace

powershell
mkdir my-codex-project
cd my-codex-project
codex

macOS

Install CodeX

bash
npm install -g @openai/codex@latest
codex --version

Integrate API Service

Create configuration directory:

bash
mkdir -p ~/.codex
cd ~/.codex

Create config.toml:

bash
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
EOF

Create auth.json:

bash
cat > auth.json << 'EOF'
{
  "OPENAI_API_KEY": "paste your CodeX-specific token here"
}
EOF

Initialize a Workspace

bash
mkdir my-codex-project
cd my-codex-project
codex

Linux

Install CodeX

bash
sudo npm install -g @openai/codex@latest
codex --version

Integrate API Service

Create configuration directory:

bash
mkdir -p ~/.codex
cd ~/.codex

Create config.toml:

bash
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
EOF

Create auth.json:

bash
cat > auth.json << 'EOF'
{
  "OPENAI_API_KEY": "paste your CodeX-specific token here"
}
EOF

Initialize a Workspace

bash
mkdir my-codex-project
cd my-codex-project
codex

FAQ

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/

More Questions

Read the FAQ or contact support.

Friendly, practical, and reliable AI coding support