Codex
Use TokenByte from the OpenAI Codex CLI
Codex CLI is OpenAI's official terminal coding agent. TokenByte's OpenAI-compatible endpoint is a drop-in replacement for the default, and the recommended setup is to pin it in ~/.codex/config.toml plus an environment variable.
Prerequisites
- Node.js 20+ (download)
- On Windows, install Git; it's optional on macOS / Linux
- A TokenByte API key from the console
Configuration
Install Codex CLI
sudo npm install -g @openai/codexRun from CMD or PowerShell:
npm install -g @openai/codexWire in TokenByte
In the .codex folder under your home directory, create config.toml:
model_provider = "tokenbyte"
model = "gpt-5-codex"
model_reasoning_effort = "high"
disable_response_storage = true
[model_providers.tokenbyte]
name = "tokenbyte"
base_url = "https://api.tokenbyte.ai/v1"
wire_api = "responses"
env_key = "TOKENBYTE_API_KEY"Then export the key as TOKENBYTE_API_KEY:
echo 'export TOKENBYTE_API_KEY="sk-tb-xxxxxxxxxxxxxxxx"' >> ~/.zshrc
source ~/.zshrcsetx TOKENBYTE_API_KEY "sk-tb-xxxxxxxxxxxxxxxx"You must restart the terminal after running this.
On Windows the .codex directory may not exist — create it manually. Explorer hides dot-directories by default; either enable View → Show → Hidden items or just run mkdir.
Launch and sanity-check
From any project directory:
codexOnce the welcome screen appears, try:
Hi — please explain this code.A real reply means TokenByte is live.
VS Code extension (optional)
Only connect the VS Code extension after the CLI works end-to-end — it narrows the debug surface.
- Search the marketplace for Codex; only install the entry with the OpenAI verified badge.
- The extension reads
~/.codex/config.tomland your environment variables — nothing to re-enter in VS Code.
If codex still fails in the terminal, installing the extension won't
magically fix it — config path and env var issues usually surface there first.
Stuck? See the FAQ.