Overview
This guide walks through creating an LLM Key and pointing Claude Code at Aptible’s LLM Gateway, so every request Claude Code makes is authenticated, audited, and covered by your organization’s Model Access Policy and Spend Limit.Create an LLM Key
1
Start your trial or sign in
Sign up for or sign in to your Aptible account. Then navigate to LLM Gateway to activate your trial. You’ll receive $10 of LLM credits to get you started, which can be used with any models your organization allows.
2
Create an LLM key
Click Create Key on the LLM Gateway page and give it a descriptive name so you can identify its usage later when reviewing costs and request history.LLM Keys are scoped to your whole organization — any member can create and manage them, and a single key gives you access to every model your organization’s model access policy allows.Once created, copy the key’s token and endpoint URL. You won’t be able to see the token again after you close this window.
Configure Claude Code
The LLM Gateway provides a dedicated base URL for Claude Code under/harness/claude-code — set it once and you won’t need to change it again, even if the endpoints behind it change.
1
Set the gateway base URL
Claude Code reads its API base URL from the
ANTHROPIC_BASE_URL environment variable:2
Set your LLM Key
Claude Code authenticates with either
ANTHROPIC_AUTH_TOKEN or ANTHROPIC_API_KEY — both work against the LLM Gateway, but ANTHROPIC_AUTH_TOKEN is preferred since it’s sent as a standard bearer token:3
Persist your configuration (optional)
To avoid setting these every session, add them to your shell profile (
~/.zshrc, ~/.bashrc, etc.), or add them to a project’s .claude/settings.json:.claude/settings.json
4
Choose a model (optional)
By default, Claude Code uses its usual model selection. To pin it to a specific model available through your organization’s Model Access Policy, set:See Supported Models for the full list of model IDs, and Supported APIs for how model selection works.
5
Verify it's working
Start Claude Code and send a simple smoke-test prompt:If you get a response back, requests are flowing through the LLM Gateway. You can confirm this by checking the key’s request history in LLM Gateway to confirm, or see Audit Logging for more ways to review your request.
Troubleshooting
400 for an unrecognized or blocked model
400 for an unrecognized or blocked model
Check that the model you’re requesting (via
ANTHROPIC_MODEL or /model) is a valid model ID from Supported Models, and that it’s allowed by your organization’s Model Access Policy.402 Payment Required
402 Payment Required
Your organization has reached its monthly spend limit. See Cost Visibility & Control.

