Codex CLI
What is Codex CLI?
Codex CLI is a local coding agent that runs in your terminal. It supports custom model providers, so teams can route Codex model calls through JoyToken for centralized API key control, model routing, policy checks, wallet limits, and usage attribution.
JoyToken exposes an OpenAI-compatible Chat Completions endpoint:
Quick Start
Step 1: Install Codex CLI
Install Codex CLI by following the official Codex installation instructions for your environment.
Step 2: Create a JoyToken API key
Create a dedicated key for Codex, for example dev-codex-cli.
Recommended policy:
Step 3: Set your API key
Reload your shell:
Step 4: Configure Codex for JoyToken
Codex reads ~/.codex/config.toml. Add a JoyToken provider:
Step 5: Start Codex
Model requests now route through JoyToken.
Configuration Reference
Core settings
Model values
Why use JoyToken with Codex CLI?
Central API key control
Create dedicated Codex keys, revoke them independently, and keep local development separate from production keys.
Budget and policy controls
Apply model, tier, IP, and budget policies before a coding session can spend credits.
Usage visibility
Track Codex usage in JoyToken Logs, Usage, and Billing by API key. Split keys by developer or workflow when you need cleaner attribution.
Model flexibility
Start with auto while evaluating quality and cost. Pin a model later for repeatable workflows.