Learning resourcesReviewed · Anthropic

Roll out an LLM gateway for your organization

This guide helps administrators roll out an LLM gateway for Claude Code, but it assumes a compatible gateway is already deployed. It covers model routing, developer credentials, managed settings, streaming verification and ongoing compatibility.

Researched 25 Nov 2026

In short.

This is a rollout guide for administrators routing Claude Code through an organizational LLM gateway, but deploying and operating the gateway itself is outside its scope. It explains how to validate model routes, issue individual credentials, distribute configuration and check streaming from developer machines. Important constraints include authentication-policy conflicts, separate configuration for some environments, version-dependent behavior and gateway sessions being ineligible for the HIPAA configuration. Compatibility with any particular gateway remains unverified.

Researched and written by an AI model and checked by a second AI model. How it works

Covers the complete selected page at [https://code.claude.com/docs/en/llm-gateway-rollout.md], including prerequisites, rollout checkpoints, credential-policy conflicts, environment-specific delivery, fast-mode behavior, the HIPAA notice, maintenance and version guidance. Linked connection, protocol, settings, vendor and provider pages are excluded; statements about them are limited to descriptions on this page. No commands were executed, and no deployment behavior was tested. Product-specific compatibility, costs and licensing terms remain unknown.

The overview

Identity

The resource is the Claude Code documentation page titled Roll out an LLM gateway for your organization at [https://code.claude.com/docs/en/llm-gateway-rollout.md]. It teaches an organization-level rollout of an existing gateway that forwards Claude Code requests to an upstream model provider.

It is documentation, with configuration examples and checkpoints. It does not supply gateway software or cover deployment and operation of a particular gateway product.

Assessment

The guide is useful when a team already has a gateway and needs a concrete path from working upstream access to developer-wide configuration. Separate checkpoints address model routing, developer authentication, client configuration, settings delivery and streaming.

Its troubleshooting detail helps explain why a simple successful request does not establish readiness for real Claude Code sessions. Product-specific compatibility, reliability, throughput and deployment outcomes are not established.

Users

The primary audience is platform engineers, IT administrators and others responsible for developer access to Claude Code. Readers need the ability to configure gateway routes, issue credentials, inspect logs and arrange settings delivery.

Beginners receive a clear sequence and Bash/Zsh and PowerShell examples, but the page assumes an existing gateway and upstream provider access. Developers connecting only their own machine are directed to a separate connection guide.

Capabilities

The page teaches five rollout stages: confirm model routing, issue individual developer credentials, try Claude Code against the gateway, distribute configuration and verify from a developer machine. It includes expected HTTP results, authentication symptoms and checks using Claude Code's /status interface.

It also covers optional model discovery through GET /v1/models, additional routing headers, provider-specific configuration, credential rotation and client upgrades. Individual keys support developer usage attribution and offboarding; the x-claude-code-session-id header can group logged requests by session.

Using it

Requirements

The gateway must already serve HTTPS at the exact address developers will use, without a redirect, and route the required Claude model names. It needs an upstream provider credential with model access. Configuration can be delivered centrally through device management or configuration management, or supplied to developers for manual setup.

The demonstrated path uses the Anthropic Messages API at POST /v1/messages. The gateway must pass server-sent events and keep-alive pings as they arrive, preserve the required headers and request bodies, and return upstream errors without incompatible rewriting. The page describes a specific capability_rejected: token exception for certain cloud-provider error substitutions.

The page also requires exempting the inference path from request-body WAF inspection because source code and XML-style tags in prompts can trigger blocking rules. This is a material requirement for organizations whose gateway sits behind a web application firewall.

Mechanism

ANTHROPIC_BASE_URL directs Claude Code's API requests to the gateway. The gateway maps requested model names to upstream models and holds the provider credential. Developers receive their own gateway credentials; the provider credential does not appear in the documented client commands.

For gateways reading Authorization: Bearer, the developer key goes in ANTHROPIC_AUTH_TOKEN. For gateways reading x-api-key, it goes in ANTHROPIC_API_KEY. An apiKeyHelper can fetch the local developer's key through a command instead of storing a static key in settings.

Correct forwarding includes anthropic-beta, anthropic-version, request bodies and streaming events. Preserving upstream error wording matters because Claude Code uses it for automatic recovery.

Setup

The documented sequence starts with a minimal API request for every configured model name. A developer key is then issued and checked with the same request. Next, temporary terminal environment variables point Claude Code at the gateway for a one-shot prompt before broader distribution.

For central delivery, the page places ANTHROPIC_BASE_URL in the managed settings env block and shows apiKeyHelper alongside it. MDM, registry policy or configuration management can deliver the settings. The helper's implementation and authentication to a secrets store are left to the organization.

The page warns against combining gateway credentials with forceLoginMethod, forceLoginOrgUUID or forceLoginGatewayUrl. These settings can impose a different sign-in requirement and prevent developers from proceeding. After distribution, /status should show the gateway address and, for managed delivery, managed settings among the setting sources.

Example

For a bearer-token gateway, the example sets ANTHROPIC_BASE_URL to [https://llm-gateway.example.com] and ANTHROPIC_AUTH_TOKEN to a developer key, then runs claude -p "Reply with one word: connected". The address is a placeholder. The expected checkpoint is a response plus a gateway log entry for POST /v1/messages with status 200; the URL may also contain a query string.

A separate streaming example uses curl -N with stream set to true, max_tokens set to 16 and the prompt "count to 3". Incrementally arriving data: lines are the expected result. A complete response arriving after a pause indicates buffering according to the guide. These are documented expectations; no commands or requests were executed.

Assessment & evidence

Limitations

Managed settings do not configure every environment by themselves. The desktop app needs its third-party inference configuration, CI runners need environment variables, and WSL inherits Windows managed settings only when wslInheritsWindowsSettings is true.

Routing inference through the gateway does not establish that every network request follows that route. Fast mode's availability check calls api.anthropic.com directly. The page lists conditional settings for restoring fast mode when that check fails, is intercepted or lacks the expected credential.

Sessions using a gateway are explicitly ineligible for the HIPAA configuration. Managed feature restrictions do not reproduce that configuration completely: the page identifies gaps involving cloud sessions and credentials in child processes. It also warns that CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC disables the auto-updater while leaving WebFetch enabled.

The page leaves gateway deployment, vendor-specific credential management and secrets-helper implementation to other documentation. It does not demonstrate compatibility with a named gateway product.

Reasoning

The staged checkpoints address different failure boundaries. A minimal successful API response establishes a route to the provider for that model name. A developer-machine streaming request additionally checks the developer network path and response delivery. Real Claude Code traffic can expose WAF or forwarding problems that short requests miss.

Authentication diagnosis depends on which component generated a 401. A gateway rejection points to the developer key or credential header; an upstream rejection points to the provider credential held by the gateway. A 404 is identified as a model-routing problem in the documented checks.

Model configuration also needs attention beyond the main session. Some background calls request built-in model IDs despite overrides. Unrecognized gateway aliases can receive default assumptions for reasoning, effort and context size until their model identity or capabilities are mapped appropriately.

Alternatives

For individual developer setup, the page points to Connect Claude Code to an LLM gateway at [https://code.claude.com/docs/en/llm-gateway-connect.md]. For protocol requirements, it points gateway operators to [https://code.claude.com/docs/en/llm-gateway-protocol.md]. These are related resources identified by this page; their contents are outside the supplied evidence.

Within this guide, manual distribution is an alternative to centrally managed settings: provide each developer the gateway URL, personal credential, correct credential-variable name and any conditional settings. The page does not compare gateway vendors or establish a preferred product.

Evidence

The complete documentation page at [https://code.claude.com/docs/en/llm-gateway-rollout.md] contains prerequisites, gateway requirements, five rollout stages, shell examples, expected checkpoints, troubleshooting symptoms and upgrade guidance.

Its examples describe expected behavior rather than measured deployment results. No commands, client sessions or gateway operations were executed. Reliability, latency, throughput and product-specific compatibility remain unassessed.

Access & freshness

Costs

The page gives no prices for gateway software, hosting, Claude Code access or upstream model usage. Total cost and the charges associated with its verification requests are unknown.

For capacity planning, it says Claude Code can retry transient failures, including 429 responses, up to 10 times with backoff while honoring Retry-After. It provides no measured throughput, rate-limit sizing figures or cost estimates.

Rights

The supplied page does not state a license or redistribution permission for its text or code examples. Public availability alone does not establish those permissions.

Terms for Claude Code, the chosen gateway and the upstream provider are not included. Their licensing, data-processing terms and applicable usage rights remain unknown from this page.

Freshness

The page was captured on 2026-11-25. No publication date or last-updated date appears in the supplied text, so its revision history and later changes are unknown.

Two explicit feature thresholds are Claude Code v2.1.273 or later for gateway hint headers and v2.1.236 or later for ANTHROPIC_DEFAULT_MODEL. The page does not establish a general minimum version for the entire rollout.

Client upgrades can change request fields, feature-flag defaults, default models and alias behavior. The guide recommends controlling upgrades with requiredMaximumVersion or, for an organization's own distribution channel, DISABLE_UPDATES, then checking the changelog and gateway behavior before advancing versions.

Actions

Before using the guide, confirm that an existing gateway meets its HTTPS, routing, streaming, forwarding, error-handling and WAF requirements. Inventory the main and background model names, identify the credential header and choose a way to deliver individual credentials.

Follow the documented routing, developer-key and Claude Code checkpoints, then verify streaming for every routed model from a developer machine. Check settings arrival, login-policy conflicts and any separate desktop, CI or WSL configuration.

Review the fast-mode exception and HIPAA limitation against organizational requirements. Obtain gateway and provider pricing separately, and plan for credential rotation, model-route updates and controlled client upgrades.

Evidence for this report

selected-page.txtselected · checked 2026-11-25