BUZZ AI Gateway
Docs · Guides · Claude Code

Configure Claude Code with BUZZ

Point the Claude Code CLI at the BUZZ AI Gateway with two environment variables. Existing projects, settings, and shell habits keep working. The model identifiers are unchanged; only the destination host moves.

BASE https://buzzai.cc
One-line installer. If you just want it to work, run curl -fsSL https://buzzai.cc/sh/claudecode.sh | bash and skip the manual setup. The rest of this page is for everyone who wants to know what the installer is doing under the hood, who needs Windows-specific instructions, or who is debugging a stuck install.

The two variables that matter

Claude Code is built on the official Anthropic SDK. Two environment variables steer it:

VariableSet it toPurpose
ANTHROPIC_BASE_URLhttps://buzzai.ccDestination host. The CLI appends /v1/messages, /v1/models, etc., so use the host root only — no trailing path, no trailing slash.
ANTHROPIC_AUTH_TOKENYour BUZZ key, e.g. sk-...Sent as Authorization: Bearer <value>. BUZZ accepts the key with or without the sk- prefix.
Do not also set ANTHROPIC_API_KEY. That variable is sent as the legacy x-api-key header and is intended for first-party Anthropic credentials. When both variables are set, behavior depends on SDK version. The safe pattern is to set only ANTHROPIC_AUTH_TOKEN and explicitly unset ANTHROPIC_API_KEY.

macOS and Linux

The workflow is identical on both. The only difference is which shell startup file you edit.

# ~/.zshrc
export ANTHROPIC_BASE_URL="https://buzzai.cc"
export ANTHROPIC_AUTH_TOKEN="sk-YOUR_BUZZ_KEY"
unset ANTHROPIC_API_KEY

# Reload and verify
source ~/.zshrc
echo "$ANTHROPIC_BASE_URL"
echo "${ANTHROPIC_AUTH_TOKEN:0:8}..."

# Run the CLI
claude
# ~/.bashrc  (Linux)  or  ~/.bash_profile  (macOS)
export ANTHROPIC_BASE_URL="https://buzzai.cc"
export ANTHROPIC_AUTH_TOKEN="sk-YOUR_BUZZ_KEY"
unset ANTHROPIC_API_KEY

source ~/.bashrc
echo "$ANTHROPIC_BASE_URL"
echo "${ANTHROPIC_AUTH_TOKEN:0:8}..."

claude
# ~/.config/fish/config.fish
set -Ux ANTHROPIC_BASE_URL "https://buzzai.cc"
set -Ux ANTHROPIC_AUTH_TOKEN "sk-YOUR_BUZZ_KEY"
set -e ANTHROPIC_API_KEY

echo $ANTHROPIC_BASE_URL
claude

Printing the first eight characters of the token is a small habit worth picking up. It confirms the variable is set without committing the full secret to scrollback or to a recorded session.

For a per-project override that does not pollute your shell profile, use a .envrc with direnv, or a .env file consumed by your task runner — both keep the override scoped to the project directory.

Windows

Two reasonable shells: PowerShell (recommended) and Command Prompt. Both can configure the same variables; only the syntax differs.

PowerShell, current session

$env:ANTHROPIC_BASE_URL = "https://buzzai.cc"
$env:ANTHROPIC_AUTH_TOKEN = "sk-YOUR_BUZZ_KEY"
Remove-Item Env:ANTHROPIC_API_KEY -ErrorAction SilentlyContinue

echo $env:ANTHROPIC_BASE_URL
echo $env:ANTHROPIC_AUTH_TOKEN.Substring(0, 8)

claude --print "ping"

PowerShell, persistent (user-scoped)

[Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", "https://buzzai.cc", "User")
[Environment]::SetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", "sk-YOUR_BUZZ_KEY", "User")
[Environment]::SetEnvironmentVariable("ANTHROPIC_API_KEY", $null, "User")

Open a fresh PowerShell window after running the persistent form. The current process keeps the old environment because Windows only re-reads user variables on shell start.

Command Prompt

:: Current cmd session only
set ANTHROPIC_BASE_URL=https://buzzai.cc
set ANTHROPIC_AUTH_TOKEN=sk-YOUR_BUZZ_KEY
set ANTHROPIC_API_KEY=

:: Persistent (user-scoped); requires a new cmd window to take effect
setx ANTHROPIC_BASE_URL "https://buzzai.cc"
setx ANTHROPIC_AUTH_TOKEN "sk-YOUR_BUZZ_KEY"

Avoid pasting the raw token into a CI log. PowerShell's Read-Host -AsSecureString is a cleaner pattern when scripting a setup that other people will inherit.

settings.json (global and project)

For a configuration that survives shell sessions, syncs through dotfiles, or differs per repo, put the values in Claude Code's settings.json. The CLI reads two files, in order, and merges them:

ScopePathWins over
Global~/.claude/settings.json (macOS / Linux) · %USERPROFILE%\.claude\settings.json (Windows)nothing
Project.claude/settings.json in the directory where you launch the CLIglobal

The structure is JSON with an env block. Keys inside env are exported into the CLI's process environment before the request goes out, so this is functionally equivalent to a shell export but stored on disk.

Global setup

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://buzzai.cc",
    "ANTHROPIC_AUTH_TOKEN": "sk-YOUR_BUZZ_KEY"
  },
  "model": "claude-opus-4-7",
  "permissions": {
    "allow": ["Read", "Edit", "Bash(git status)"]
  }
}

Project override

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://buzzai.cc",
    "ANTHROPIC_AUTH_TOKEN": "sk-PROJECT_TEAM_KEY"
  },
  "model": "claude-sonnet-4-6"
}
Don't commit a real token. Add .claude/settings.json to .gitignore and check in a .claude/settings.json.example with placeholder values. Shell environment variables take precedence over settings.json when both are set, which is exactly what you want when you need a temporary override.

Verifying the switch works

Configuration you cannot verify is configuration you do not trust. Three checks, in order of decreasing convenience:

1. Run the CLI in debug mode

claude --debug --print "Say hi" 2>&1 | grep -i "base\|host\|http"

Debug output prints the resolved base URL the SDK is about to use. If you see https://buzzai.cc in the trace and a 200 from a request to /v1/messages, the configuration is live.

2. curl the endpoint directly

Skip the CLI entirely and reproduce the request shape with curl. This isolates whether a problem is in the CLI or in the endpoint.

curl -sS https://buzzai.cc/v1/messages \
  -H "Authorization: Bearer $ANTHROPIC_AUTH_TOKEN" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{
    "model": "claude-haiku-4-5-20251001",
    "max_tokens": 64,
    "messages": [{"role": "user", "content": "Reply with the single word: pong."}]
  }' | jq '.content[0].text, .usage'

A success returns the model's text and a usage object with input_tokens and output_tokens. A failure returns an error envelope whose type field tells you exactly what to fix.

3. Probe the model list

curl -sS https://buzzai.cc/v1/models \
  -H "Authorization: Bearer $ANTHROPIC_AUTH_TOKEN" | jq '.data[].id' | head -20

If curl works but the CLI does not, the problem is environment plumbing, not the endpoint. Check that the variables are exported (not just set) and that the shell you ran claude from is the one with the exports loaded.

Common errors and fixes

401 Unauthorized after switching to BUZZ

Cause: ANTHROPIC_API_KEY is set with a BUZZ token, so the CLI sends x-api-key through a path that expected Authorization: Bearer.
Fix: unset ANTHROPIC_API_KEY and put the value in ANTHROPIC_AUTH_TOKEN instead.

404 Not Found on /v1/messages

Cause: ANTHROPIC_BASE_URL includes a path, e.g. https://buzzai.cc/v1. The SDK appends its own path on top, producing /v1/v1/messages.
Fix: set the base to the host root only — https://buzzai.cc, no trailing path and no trailing slash.

503 model_not_found

Cause: the model alias is not available under your group. BUZZ returns HTTP 503 with buzz_error / model_not_found when no upstream channel can serve the requested model.
Fix: call GET /v1/models to see the live list, then either switch to an available alias or use a dated form like claude-haiku-4-5-20251001.

CLI keeps hitting api.anthropic.com despite the export

Cause: the variable was set in one shell but claude was launched from another (different terminal app, IDE process, or tmux pane).
Fix: verify with printenv ANTHROPIC_BASE_URL in the exact shell that runs the CLI, then restart the IDE or terminal so it inherits fresh values.

SSL or TLS handshake failure

Cause: a corporate proxy intercepting outbound HTTPS without a trusted root certificate.
Fix: add the proxy's CA to the system trust store, or set NODE_EXTRA_CA_CERTS=/path/to/ca-bundle.pem for the Claude Code process.

OAuth login keeps overriding the token

Cause: a prior claude login session stored credentials that the CLI prefers over ANTHROPIC_AUTH_TOKEN when pointed at api.anthropic.com.
Fix: run claude logout, then re-run with the env vars set so the CLI uses the token path exclusively.

Pinning a default model

Claude Code accepts a model field in settings.json that becomes the default for new sessions. Useful values, all returned by GET /v1/models on a typical group:

Dated aliases (e.g. claude-haiku-4-5-20251001) are also accepted. If the undated alias returns 503 model_not_found on your group, switch to the dated form. The full live list is at GET /v1/models.

See also