Codex CLI
Codex CLI uses the OpenAI API. Point it at the OpenAI-compatible gateway.
Quick Start
This guide helps you get Codex CLI running through the gateway in a few minutes.
Step 1: Install Codex CLI
Follow the Codex CLI installation guide to install the CLI on your system.
Step 2: Configure Codex
Codex uses a config.toml file, usually at ~/.codex/config.toml. Create or edit it with the following:
model_provider = "llmpool"
model_reasoning_effort = "high"
model="~openai/gpt-latest"
[model_providers.llmpool]
name = "llmpool"
base_url="https://api.aifarmer.vip/openai/v1"
env_key="LLMPOOL_API_KEY"
Step 3: Set your API key
# Add to ~/.zshrc, ~/.bashrc, or ~/.config/fish/config.fish
export LLMPOOL_API_KEY="..."
Step 4: Start coding
cd /path/to/your/project
codex
Step 5: Verify
Run /status in Codex CLI to confirm your connection.
> /status
Model provider: llmpool - ...
Diagnose a failed connection
If Codex is still unavailable after importing through CC Switch, download check-codex-integration.sh from the Integrations page, open a terminal in the download folder, and run:
chmod +x check-codex-integration.sh && ./check-codex-integration.sh
The script checks Codex CLI, CC Switch's active Codex Provider database record, ~/.codex/config.toml, the authentication source, and the /models response. It then sends one minimal Responses API request and one real codex exec request by default. It never prints the API key. When codex exec passes, the configured Codex request flow to this gateway and model is working; the probe does not cover every streaming, tool, or MCP feature.
The two requests may be billable. Skip either one when needed:
./check-codex-integration.sh --skip-responses
# Or skip only the Codex end-to-end request:
./check-codex-integration.sh --skip-codex-exec