TokenByteTokenByte Docs

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/codex

Run from CMD or PowerShell:

npm install -g @openai/codex

Verify the install

codex --version

Output like codex-cli 0.41.0 means it's ready.

Wire 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 ~/.zshrc
setx 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:

codex

Once 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.toml and 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.

On this page