• UnoRouterUNOROUTER
Documentation
  • AI Applications
Coding agents
  • opencodeOpenCode Setup Guide
  • Kilo CodeKilo Code Setup Guide
  • Zed IDE Setup Guide
  • ClineCline Setup Guide
  • RooCodeRoo Code Setup Guide
  • continue-devContinue.dev Setup Guide
Character & fiction clients
  • SillyTavernSillyTavern Integration Guide
  • janitor-aiJanitor.AI Integration Guide
  • risuaiRisuAI Integration Guide
  • Chub / Venus Integration Guide
  • nevikaNevika Integration Guide
Chat clients
  • librechatLibreChat Integration Guide
  • OpenWebUIOpen WebUI Integration Guide
  • LobeHubLobeChat Integration Guide
  • AnythingLLM Integration Guide
  • CherryStudioCherry Studio Integration Guide
  • typingmindTypingMind Integration Guide
  • BoltAI Integration Guide
  • Page Assist Integration Guide
  • chatboxChatbox Integration Guide
  • Big-AGI Integration Guide
CLI tools
  • aiderAider Setup Guide
  • cc-switchCC Switch Integration Guide
  • Claude CodeClaude Code Integration
  • CodexOpenAI Codex CLI Setup Guide
  • GeminiGemini CLI Integration
  • openclawOpenClaw Integration
  • Hermes AgentHermes Agent Integration
  • ModelContextProtocolMCP Server Setup Guide
Navigate
  • Models
  • Rankings
  • Inspector
  • Pricing
  • Chat
  • Status

Search docs...

Start typing to search documentation

PlatformIntegrationsChat
Codex
Codex CLI

OpenAI Codex CLI Setup Guide

Step-by-step guide to install and configure Codex CLI with UnoRouter on Windows, macOS, and Linux.

Overview

Codex CLI is OpenAI's terminal-based coding agent that reads, writes, and runs code in your project through sandboxed, reviewable patches. Point its custom provider at UnoRouter's base URL and you can drive it with any model from the catalog, not just OpenAI's.

Quick Config

Drop these values into the client. Your key auto-fills when you are signed in.

text
Base URL: https://api.unorouter.com/v1
API Key: YOUR_API_KEY

Sign in to auto-fill your API key

Compatibility

Chat CompletionsResponses APIStreamingTool calling

Step-by-step setup

  1. 1
    Install Codex CLI

    Install the Codex CLI globally with npm.

    bash
    npm install -g @openai/codex

    Sign in to auto-fill your API key

  2. 2
    Configure the model provider

    Edit `~/.codex/config.toml` to point Codex at UnoRouter. Set your model id and add a custom provider with UnoRouter's base URL using the responses wire API.

    toml
    # ~/.codex/config.toml
    model = "YOUR_MODEL_ID"
    
    [model_providers.custom]
    base_url = "https://api.unorouter.com/v1"
    wire_api = "responses"

    Sign in to auto-fill your API key

  3. 3
    Add your API key

    Write your UnoRouter API key into `~/.codex/auth.json` so Codex authenticates every request.

    json
    // ~/.codex/auth.json
    {
      "OPENAI_API_KEY": "YOUR_API_KEY"
    }

    Sign in to auto-fill your API key

  4. 4
    Start Codex

    Run `codex` in your project directory and start coding.

    bash
    codex

    Sign in to auto-fill your API key

powershell
$env:OPENAI_BASE_URL="https://api.unorouter.com/v1"
$env:OPENAI_API_KEY="YOUR_API_KEY"

codex

Sign in to auto-fill your API key

Recommended models

Free models that work well here. Paste any model id into the client.

agnes-2.0-flash:freeallam-2-7b:freebielik-11b-v3.0-instruct:freecodestral-latest:freecommand-r:free

Gotchas

  • !If Codex reports an unsupported endpoint, confirm `wire_api` is set to `responses` and the base URL ends in `/v1`.
  • !A 401 means the key in `~/.codex/auth.json` is missing or stale. Paste a fresh key from your UnoRouter dashboard and rerun.
Generate API KeyModels

On this page

Overview
Quick Config
Compatibility
Setup steps
Install Codex CLI
Configure the model provider
Add your API key
Start Codex
Recommended models
Gotchas