Codex setup
Codex is OpenAI’s coding assistant for the terminal. Connect it to TokenReply and use it with your TokenReply key. Official documentation
Before you start
- Node.js 18+ (see Install Node.js)
- A TokenReply API key, created in API key management
Installation
npm install -g @openai/codex@latest
codex --versionConfiguration
Codex reads its settings from ~/.codex/. You’ll create two files there:
Step 1: create the config folder
macOS / Linux
mkdir -p ~/.codex && cd ~/.codexWindows (PowerShell)
mkdir $env:USERPROFILE\.codex
cd $env:USERPROFILE\.codexStep 2: create config.toml
model_provider = "custom"
model = "codex-mini-latest"
approval_policy = "on-request"
[model_providers.custom]
name = "TokenReply"
base_url = "https://api.tokenreply.com/v1"
wire_api = "responses"
requires_openai_auth = trueStep 3: create auth.json
{
"OPENAI_API_KEY": "sk-xxx"
}Replace sk-xxx with your API key.
Check the model
Set model in config.toml to a model your key can call. You’ll find model IDs on the Models page.
Start Codex
cd your-project
codexTroubleshooting
Connection failed
- Check that
base_urlishttps://api.tokenreply.com/v1 - Check that the key works and you have usage allowance or wallet balance left
- Check where the config files are and that they’re valid
Where the config files live
- macOS / Linux:
~/.codex/ - Windows:
%USERPROFILE%\.codex\
Related guides
- Create and manage keys in API key management
- Look up URLs and headers in Base URL and authentication
- Switch Codex settings from a desktop app with CC-Switch
