Skip to main content
Connect Claude Code with your BetterToken API Key, Base URL https://bettertoken.ai, and the Model ID you want to use. Copy the exact Model ID from the model plaza.

Key settings

Prerequisites

Install

Command-line setup

The BetterToken Automatic setup script writes the Claude Code provider configuration. It requires Node.js and prompts for the API Key when one is not passed as an argument.
After it finishes, inspect ~/.claude/settings.json (or %USERPROFILE%\.claude\settings.json on Windows) and fully restart Claude Code. Use the manual setup below when you want to control each field yourself.

Manual setup

Copy the exact Model ID from the model plaza.
Replace YOUR_MODEL_ID with the Model ID you copied. Set ANTHROPIC_MODEL for the main model and the three ANTHROPIC_DEFAULT_*_MODEL variables for the Haiku, Sonnet, and Opus aliases. You can map them to the same model or choose a different model for each role.

VS Code extension

The extension uses VS Code settings.json. Add a separate claudeCode.environmentVariables configuration:

Verify the connection

Start Claude Code in your project:
Send a short message. A normal response without 401, connection, or model errors confirms the setup. Fully restart Claude Code after changing the file.

Switch models

Update the Model ID in your configuration and restart Claude Code. To switch during a session, use /model YOUR_MODEL_ID.

Common errors

Advanced setup

To manage several tool configurations in one app, see CC Switch.

Technical details

Claude Code uses Anthropic Messages. Set ANTHROPIC_BASE_URL to https://bettertoken.ai; the client appends /v1/messages, so do not add /v1 to the Base URL.