Skip to content

Integration

Use Codex CLI with Tokens

Add Tokens as a custom model provider in Codex CLI's config.toml, keep the key in an environment variable, and handle models whose upstream doesn't support the Responses API.

Set it up in one command

The Tokens CLI signs you in through the browser, creates a key, lets you pick a model and writes Codex CLI's settings, keeping a backup of the old file. It needs Node 18 or newer.

curl -fsSL https://tokens.bd/cli/tokens.mjs -o tokens.mjs && node tokens.mjs setup --base-url https://tokens.bd --agents codex

What Codex CLI connects to

OpenAI-compatible base URL
https://tokens.bd/v1
API key
One Tokens key (tok_live_…), with its own spending cap
Models
Any id from the model catalog

What the guide covers

5 min read

  1. 01Quick setup with the Tokens CLI
  2. 02Export TOKENSAPIKEY
  3. 03Configure /.codex/config.toml manually
  4. 04Switch models
  5. 05Verify it works
  6. 06Troubleshooting

Ready to try Codex CLI on Tokens?

Create an account, make a key and send your first request in a couple of minutes.

Create an account