Claude Code
Claude Code speaks the Anthropic Messages API. Waibee Router accepts requests in the same format on POST /v1/messages, so Claude Code connects to it through environment variables, with no changes to the client itself.
Environment variables
Section titled “Environment variables”| Variable | Value |
|---|---|
ANTHROPIC_BASE_URL | The router’s base URL, without the /v1/messages suffix (the client adds the path itself). |
ANTHROPIC_AUTH_TOKEN | Your Waibee API key (sk_live_...). Sent as Authorization: Bearer. |
ANTHROPIC_API_KEY | An empty string, so the client does not send a different key from the environment in x-api-key. If both headers arrive, the router takes the key from x-api-key. |
export WAIBEE_API_KEY="sk_live_..."export ANTHROPIC_BASE_URL="https://api.waibee.com"export ANTHROPIC_AUTH_TOKEN="$WAIBEE_API_KEY"export ANTHROPIC_API_KEY=""claudeA key from the variable takes precedence over a saved claude.ai sign-in. If Claude Code warns about two authentication sources at startup, run /logout, and only the Waibee key remains.
Choosing a model
Section titled “Choosing a model”- For one run:
claude --model <name>. Both catalog IDs and Anthropic names without a prefix work; see Anthropic-compatible clients. - By role:
ANTHROPIC_DEFAULT_OPUS_MODEL,ANTHROPIC_DEFAULT_SONNET_MODEL, andANTHROPIC_DEFAULT_HAIKU_MODELset the models behind theopus,sonnet, andhaikualiases, andCLAUDE_CODE_SUBAGENT_MODELsets the subagent model. They accept both short Anthropic names and catalog IDs. - Background tasks: with the key in
ANTHROPIC_AUTH_TOKEN, Claude Code runs them on the main model. To run them on a cheaper one, set it inANTHROPIC_DEFAULT_HAIKU_MODEL.
For Claude models, pass the short Anthropic names: claude-sonnet-4-6, claude-haiku-4-5. Claude Code interprets catalog IDs its own way: it does not recognize anthropic/claude-haiku-4.5, warns about it, and keeps the session within 200,000 tokens. It also mistakes anthropic/claude-sonnet-4.6 for the deprecated Claude Sonnet 4. For a model Claude Code does not know, the CLAUDE_CODE_MAX_CONTEXT_TOKENS variable sets the context window.
Extension for VS Code and Cursor
Section titled “Extension for VS Code and Cursor”The extension checks the key before it starts Claude Code, and it takes the variables from its own claudeCode.environmentVariables setting in the editor’s user settings. Values from ~/.claude/settings.json do not reach this check.
{ "claudeCode.environmentVariables": [ { "name": "ANTHROPIC_BASE_URL", "value": "https://api.waibee.com" }, { "name": "ANTHROPIC_AUTH_TOKEN", "value": "sk_live_..." } ]}Checking the setup
Section titled “Checking the setup”In a Claude Code session, run /status. The Anthropic base URL line should show https://api.waibee.com, and the Auth token line should name ANTHROPIC_AUTH_TOKEN.
The router has no /v1/messages/count_tokens endpoint. Without it, Claude Code estimates tokens from the character count, so /context shows approximate numbers.