Skip to content

Codex Setup ​

Codex is OpenAI's command-line coding tool. To use it through Yunxi AI, configure a Yunxi AI model provider and authenticate with a dedicated Codex key.

Prerequisites ​

  1. You have signed in to https://ai.laiber.cloud.
  2. You have created a Codex API key.
  3. Node.js and npm are installed.

Recommended

If CC-Switch is installed, open the key action menu, choose CC Switch, select Codex, and import the model profile directly. The config.toml method below is a manual fallback.

Install Codex ​

bash
npm install -g @openai/codex@latest

Verify:

bash
codex --version

Create the config directory ​

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

Write config.toml ​

The example below uses the OpenAI Responses-compatible endpoint. Adjust model based on models available to your account.

toml
model_provider = "yunxi"
model = "gpt-5.5"
model_reasoning_effort = "high"
disable_response_storage = true

[model_providers.yunxi]
name = "Yunxi AI"
base_url = "https://ai.laiber.cloud/v1"
wire_api = "responses"
requires_openai_auth = true

Write auth.json ​

Replace sk-xxx with your Codex key:

json
{
  "OPENAI_API_KEY": "sk-xxx"
}

Start Codex ​

bash
cd your-project
codex

Ask Codex to inspect the current directory or create a small test file to confirm requests are working.

FAQ ​

Can Codex and Claude Code share one key? ​

Not recommended. Their protocols and model groups may differ, so separate keys are easier to debug and revoke.

Where are config files stored? ​

By default, Codex reads from ~/.codex.

Stable, clear, and easy to connect