https://bettertoken.ai, and the Model ID you want to use. Copy the exact Model ID from the model plaza.
Key settings
Prerequisites
- Install the latest Claude Code
- Install Node.js
- Create and copy a BetterToken API Key
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.- macOS / Linux
- Windows
~/.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.
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 Codesettings.json. Add a separate claudeCode.environmentVariables configuration:
Verify the connection
Start Claude Code in your project: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.Related FAQ
- What is Claude Code and how does it work?
- Does Claude Code use a Claude.ai account or an API Key?
- Claude Code custom API endpoint: API Key and Base URL
- How to connect Kimi K3 to Claude Code
- OpenAI-compatible API vs Anthropic-compatible API
- What is CLAUDE.md in Claude Code?
- Why Claude Code uses so many tokens and how to reduce cost
- Claude Code vs Cursor for local development
- Claude Code vs Codex CLI
- How to switch Sonnet and Opus in Claude Code
- Claude Code permissions and hooks
- MCP vs API Key and Base URL
Technical details
Protocol and endpoint
Protocol and endpoint
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.
