๐ค CodeX Setup
CodeX is OpenAI's GPT-based AI coding assistant CLI tool. By routing through this platform, you can access CodeX with a unified API key. Official docs
๐ Prerequisites
- Node.js 18+ (see Install Node.js)
- An API key from this platform (create one in API Key Management)
โก Installation
npm install -g @openai/codex@latest
codex --versionโ๏ธ Configuration
CodeX stores configuration in ~/.codex/. You need to create two files:
Step 1: Create Config Directory
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.
โ ๏ธ Important
Ensure your token has access to CodeX / GPT models. Different models may require different token group permissions.
๐ Start Using
cd your-project
codexโ Troubleshooting
Connection Failed
- Verify
base_urlis set tohttps://api.tokenreply.com/v1 - Verify the API key is valid and the account has in-plan usage available; once in-plan usage runs out, paid models fall through to the wallet balance, so make sure it is sufficient
- Check config file paths and format
Config File Locations
- macOS / Linux:
~/.codex/ - Windows:
%USERPROFILE%\.codex\
