Quick take
The addresses and keys below are examples. Use the exact Base URL and credential delivered with your order without adding or removing /v1.
What you need
Before configuring Claude Code, make sure you have Claude Code installed, the production gateway Base URL, your redeemed API key and a supported model route.
If Claude Code is not installed, follow the official Claude Code installation guide.
Configure Claude Code on macOS or Linux
Open Terminal and enter the following values, replacing the example address and key with the credentials delivered with your order.
export ANTHROPIC_BASE_URL="https://llm-gateway.example.com"
export ANTHROPIC_AUTH_TOKEN="YOUR_GATEWAY_KEY"
claude
These values apply to Claude Code started from that terminal session. After Claude Code opens, send a simple test message such as Reply with: Gateway connected., then run /status.
The Status tab should display the configured gateway under Anthropic base URL and show ANTHROPIC_AUTH_TOKEN as the active credential source.
Configure Claude Code on Windows PowerShell
Open PowerShell and enter:
$env:ANTHROPIC_BASE_URL = "https://llm-gateway.example.com"
$env:ANTHROPIC_AUTH_TOKEN = "YOUR_GATEWAY_KEY"
claude
Send a test message and run /status after Claude Code starts. Confirm that the Base URL and credential source match the values you configured.
Save the configuration
Shell variables disappear when that terminal session closes. To make the gateway available in future Claude Code sessions, add it to your user settings file.
Use ~/.claude/settings.json on macOS, Linux or WSL. On Windows, the user settings file is %USERPROFILE%\.claude\settings.json.
{
"env": {
"ANTHROPIC_BASE_URL": "https://llm-gateway.example.com",
"ANTHROPIC_AUTH_TOKEN": "YOUR_GATEWAY_KEY"
}
}
Do not place your credential in a shared .claude/settings.json file that could be committed to a repository.
If your delivery specifies ANTHROPIC_API_KEY
Gateway credentials can be sent in two different headers. Use ANTHROPIC_AUTH_TOKEN when the delivery instructions specify a bearer token or Authorization header. Use ANTHROPIC_API_KEY when they specify an API key or x-api-key header.
Follow the variable named in your delivery instructions. Do not configure both unless instructed.
Select a supported model
Use the model ID included with your delivery or choose a currently available route from the live model pricing page.
After selecting the route, send another test message and check the dashboard to confirm that the request and usage deduction were recorded.
FAQ
Do I need to log in with a Claude subscription? +
No. When the gateway Base URL and credential are active, requests use the gateway rather than billing through a personal Claude subscription.
Should I use ANTHROPIC_AUTH_TOKEN or ANTHROPIC_API_KEY? +
Use the variable specified in your delivery instructions. ANTHROPIC_AUTH_TOKEN sends a bearer token, while ANTHROPIC_API_KEY sends the credential through the x-api-key header.
How do I confirm Claude Code is using the gateway? +
Run /status inside Claude Code. The Status tab should show the gateway address under Anthropic base URL and identify the active token or API-key variable.
Can I save the configuration permanently? +
Yes. Add the variables to ~/.claude/settings.json or the equivalent Windows user settings file. Keep credentials out of shared project files.
Where can I find the supported model IDs? +
Check the live model pricing page for the current model routes and prices.
Ready to compare live options?