API Unlimit
/Docs/OpenAI Codex CLI
Setup Guide

OpenAI Codex CLI Setup

Route Codex CLI through API Unlimit using ~/.codex/config.toml and ~/.codex/auth.json.

1

Install Codex CLI

bash
npm install -g @openai/codex
2

Create config.toml

Create ~/.codex/config.toml:

~/.codex/config.toml
# ~/.codex/config.toml
model = "claude-sonnet-4-6"
model_provider = "9router"

[model_providers.9router]
name = "9Router"
base_url = "https://apiunlimit.com/v1"
wire_api = "responses"

[agents.subagent]
model = "claude-sonnet-4-6"

Change the model IDs to match your plan.

3

Create auth.json

Create ~/.codex/auth.json:

~/.codex/auth.json
{
  "auth_mode": "apikey",
  "OPENAI_API_KEY": "sk-YOUR_KEY_HERE"
}

Replace sk-YOUR_KEY_HERE with your API key.

info
Codex uses OPENAI_API_KEY in auth.json — not ANTHROPIC_AUTH_TOKEN.
4

Test it

bash
codex "hello"
check_circle
If Codex responds without errors, you're connected.

Don't have an API key yet?

Contact us on Zalo or Telegram — key activated within minutes after payment.

shopping_cartView Pricing