Claude Code logo
Coding agents

Use TokenRex with Claude Code

Run Anthropic's terminal coding agent on TokenRex Claude models.

Before you start

  • Node.js and Claude Code
  • A TokenRex API key
  • A Claude model ID from the Models page

Step-by-step setup

  1. 1

    Install Claude Code with npm install -g @anthropic-ai/claude-code.

  2. 2

    Create a TokenRex key on the API Keys page and copy it when it is shown.

  3. 3

    Add the environment settings below to ~/.claude/settings.json. Create the file if it does not exist.

  4. 4

    Replace tb_sk_... with your key. Keep the Anthropic base URL without /v1.

  5. 5

    Open a new terminal in your project folder and run claude.

Configuration

json
// ~/.claude/settings.json
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://tokenrex.ai/api/public",
    "ANTHROPIC_AUTH_TOKEN": "tb_sk_...",
    "ANTHROPIC_MODEL": "anthropic/claude-opus-5-5",
    "ANTHROPIC_SMALL_FAST_MODEL": "anthropic/claude-haiku-4-5"
  }
}

Verify the connection

Ask Claude Code to explain one file, then check that the request and Claude model appear in your Dashboard.