Codex CLI
OpenAI Codex CLI Setup Guide
Step-by-step guide to install and configure Codex CLI with UnoRouter on Windows, macOS, and Linux.
What is Codex CLI?
Codex CLI is a coding agent from OpenAI that runs locally on your computer.
Features
| Terminal-based | Runs entirely in your terminal, no browser or editor required. |
| Tool-driven | Uses tools to read, write, and execute code in your project. |
| Atomic Patch | Applies changes as atomic patches, making each edit easy to review. |
| Sandboxing | Runs commands in a sandboxed environment to protect your system. |
| Plan Tracking | Breaks tasks into steps, tracks progress, and explains what it is doing. |
| Multimodal Input | Accepts text, images, and file references as input context. |
Quick Setup with CC Switch
Use CC Switch to configure your provider with one click. It automatically sets the API endpoint and provider name for you.
Manual Configuration
Permanent Config File (Recommended)
Persists across sessions and terminal restarts.
%APPDATA%\codex\config.toml
toml
model = "gpt-5.1-codex-mini"
[model_providers.custom]
base_url = "https://api.unorouter.ai/v1"
wire_api = "responses"Environment Variables
Add to your shell profile. Resets when the terminal closes unless sourced from a profile file.
powershell
$env:OPENAI_BASE_URL="https://api.unorouter.ai/v1"
$env:OPENAI_API_KEY="YOUR_API_KEY"Installation
Step 2: Install WSL
Windows Subsystem for Linux is required. Run this command:
powershell
wsl --installStep 3: Install Codex CLI
bash
npm i -g @openai/codexReady to get started?
Get your API key and start using UnoRouter with Codex CLI.