- If youāre a developer connecting to an existing gateway: connect Claude Code to your gateway
- If youāre an admin rolling out a gateway for your organization: deploy and distribute a gateway
- If youāre configuring a gateway product: the gateway protocol reference
What a gateway provides
A gateway gives your organization one place to manage:- Credentials: the provider key stays server-side; developers hold gateway credentials instead
- Usage tracking: attribute usage by developer or team, regardless of which provider serves the request
- Cost controls: enforce budgets and rate limits in one place
- Audit logging: log every model request for compliance
- Provider switching: change the provider in gateway configuration, without touching developer machines
Roll out a gateway
When youāre ready to roll out an LLM gateway to your organization, the sequence is the same whichever gateway product you choose:- Deploy the gateway and give it your provider credential, so it can authenticate the requests it forwards.
- Issue each developer a gateway credential, so usage is attributed to the developer and offboarding revokes one credential.
- Distribute the configuration through a managed settings file and your secrets tooling, so every machine receives the base URL and a credential. When both are distributed, developers donāt configure anything. If you donāt have settings distribution in place, developers follow the connect page to set the variables themselves.
- Have each developer check for the configuration in Claude Code, so distribution problems surface before they depend on the gateway.
Subscriptions and gateways
While a gateway credential variable orapiKeyHelper is active, a developerās claude.ai subscription isnāt used: the credential replaces the subscription login for that session, and the subscriptionās usage limits donāt apply. That traffic is billed per token to whoever owns the credential the gateway forwards, such as your organizationās Anthropic Console account, or your Amazon Bedrock, Google Cloudās Agent Platform, or Microsoft Foundry account when the gateway routes there.
ANTHROPIC_BASE_URL is the variable that points Claude Code at the gateway. Setting only that variable, without a gateway credential, doesnāt replace the subscription. Requests still route through the gateway, but a saved claude.ai login remains the active credential, so its usage limits and billing apply. Gateways that pass this traffic on to Anthropic must forward the OAuth capability in anthropic-beta; see the request headers reference.
Related pages
- Gateway overview: how a gateway works and how to choose between Claude apps gateway and another product
- Claude apps gateway: Anthropicās self-hosted gateway with SSO sign-in and OTLP telemetry
- Connect Claude Code to an LLM gateway: set the base URL and credential on your own machine, with per-surface configuration and a troubleshooting table
- Roll out an LLM gateway for your organization: the admin checklist for deploying a gateway, issuing developer credentials, and distributing managed settings
- Gateway protocol reference: what Claude Code sends to a gateway, for operators configuring one, covering endpoints, headers to forward, and feature pass-through