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 auth.json.
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 = "<paste exact model title from /models>"
model_provider = "custom"
model_reasoning_effort = "high"
disable_response_storage = true
[model_providers.custom]
name = "custom"
base_url = "https://api.tokenbyte.ai/v1"
wire_api = "responses"The model value must match the full card title shown on the Models
page or in the Console → Models catalog.
Then create auth.json in the same .codex directory:
{
"OPENAI_API_KEY": "<your API key>"
}Replace <your API key> with the full key from Console → API Keys (e.g. sk-tb-...).
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 .codex.
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.tomlandauth.json— 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.