Learning resourcesReviewed · Anthropic

Run Claude Code through a gateway

Run Claude Code through a gateway is Anthropic's official Claude Code documentation page for administrators and platform teams, explaining how to route Claude Code through a self-hosted proxy (a gateway) for centralized credentials, usage tracking and cost controls. It explains developer authentication, shared provider credentials, usage tracking and billing. Claude apps gateway, Anthropic's bundled option, requires browser sign-in. Deployment instructions are on separate linked pages. CI pipelines that cannot complete Claude apps gateway's browser sign-in must be configured against the provider directly.

Researched 15 Nov 2026

In short.

Run Claude Code through a gateway is Anthropic's official Claude Code documentation page for administrators and platform teams, explaining how organizations route Claude Code through a self-hosted proxy (a gateway). It explains how individual gateway credentials and an organization's provider credential support centralized controls. It also distinguishes API billing from subscription billing and identifies network traffic, model selection and telemetry settings that require separate attention. Claude apps gateway, Anthropic's bundled option, requires a developer to sign in through a browser. The page supports architectural decisions; detailed deployment procedures, numeric costs and operational reliability remain unassessed. No software was executed or tested.

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/gateways.md], retained as selected-page.txt. Coverage includes architecture, credential separation, both gateway choices, automation limits, billing, model selection, network traffic, telemetry and corporate proxies. The source's non-endorsement and support limitations are included. Linked pages, the documentation index and the diagram asset were not separately assessed; the diagram's supplied text description is included. No software was executed, deployed or tested.

The overview

Identity

Run Claude Code through a gateway is a Claude Code documentation guide at [https://code.claude.com/docs/en/gateways.md]. It explains routing Claude Code's model API requests through a proxy operated by an organization.

It introduces two options: Claude apps gateway, included in the claude binary, and an existing LLM or API gateway. The selected resource is the explanatory guide; the deployment and compatibility guides it links to are separate pages not covered here.

Assessment

The guide is useful for deciding whether centralized credentials, usage accounting and access controls fit a team's Claude Code rollout. Its strongest practical contribution is explaining boundaries: a gateway handles model API routing, while subscriptions, model choice, client telemetry and other network traffic have separate rules.

It provides enough detail to compare the two gateway approaches, but not enough to deploy either from this page alone. Performance, reliability, security configuration and actual enforcement of budgets were not assessed.

Users

The main audience is administrators and platform teams managing Claude Code for multiple developers. Identity administrators, network operators and people responsible for provider spending also have relevant decisions here.

Developers can use the guide to understand how they sign in, which account pays for requests and which settings remain under their control. Teams building unattended CI should pay particular attention to the bundled gateway's browser sign-in requirement and lack of a service-token flow.

Capabilities

The architecture centralizes developer authentication, usage tracking, configured access and budget rules, and audit logging. Developers hold individual gateway credentials; the gateway holds the organization's provider credential.

Claude apps gateway adds corporate single sign-on through /login, model access and managed settings by identity-provider group, and usage metrics exported through OpenTelemetry Protocol, or OTLP. The page lists Amazon Bedrock, Claude Platform on AWS, Google Cloud, Microsoft Foundry and the Anthropic API as upstream options.

With an endpoint that accepts Anthropic-format requests, administrators can change the upstream provider without changing developer-machine configurations. This does not imply support for non-Claude models.

Using it

Requirements

The organization needs infrastructure to operate a gateway, access to its chosen provider and the appropriate provider credential. Developers need a configured gateway address and a supported authentication arrangement. The page does not specify server sizing, deployment topology or minimum software versions.

Claude apps gateway requires corporate identity-provider integration and browser sign-in. It has no service-token authentication flow. An existing gateway must accommodate Claude Code's changing request fields and anthropic-beta header values; its full compatibility requirements are in a separate linked guide.

Network access still needs attention because Claude Code sends version checks and downloads directly to Anthropic. The complete required-domain list is not included in this page.

Mechanism

Claude Code sends a model request to the gateway and authenticates with the developer's gateway credential. The gateway identifies the developer, applies configured rules and forwards the request using the organization's provider credential. This separates developer access from possession of provider credentials.

The gateway determines the upstream destination. Developers still choose a model through /model or model environment variables. Claude apps gateway can restrict that choice with a per-group availableModels allowlist.

The page says the bundled gateway ships alongside Claude Code and forwards the request fields and beta headers the client sends. Separately maintained gateways need forwarding rules that keep pace with client releases.

Setup

Choose the gateway approach and upstream provider first. The page directs administrators to [https://code.claude.com/docs/en/claude-apps-gateway] for the bundled gateway and [https://code.claude.com/docs/en/llm-gateway] for existing gateways. Those linked procedures are not on this page, so exact deployment commands and credential configuration are unknown here.

Plan model permissions, identity groups, observability and device settings alongside routing. Claude Code disables Anthropic-bound client analytics after signing in to Claude apps gateway; suppressing startup analytics before sign-in also requires DISABLE_TELEMETRY in client-side managed settings.

Requests to a gateway also follow HTTPS_PROXY. For Claude apps gateway sign-in through a corporate proxy, the page requires the proxy hostname to resolve to private addresses or the gateway host to be included in NO_PROXY. CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC controls optional traffic; required network access needs separate configuration.

Example

As an illustrative arrangement, a team could run Claude apps gateway in its infrastructure, connect it to Amazon Bedrock and let developers sign in through the corporate identity provider. Group policies could restrict model choices, while OTLP metrics feed the team's observability system. Requests authenticated with gateway credentials would be charged to the organization's provider account.

The page distinguishes two automation cases. Agent SDK sessions and claude -p runs on a machine where a developer has signed in can use that machine's gateway session and policies. A CI pipeline with nobody available to approve sign-in cannot authenticate through the bundled gateway; the documentation directs that case to the provider directly. This example was not executed.

Assessment & evidence

Limitations

Claude apps gateway cannot supply service-token authentication for CI without a developer to approve browser sign-in. The page also acknowledges features that behave differently in gateway sessions, but leaves their identities and details to a linked availability section.

Anthropic says it does not endorse, maintain or audit other gateway products, and does not support routing Claude Code to non-Claude models through any gateway.

A gateway does not capture all Claude Code traffic. Version checks and downloads use separate connections, optional client telemetry behavior differs by provider or sign-in arrangement, and telemetry destinations require further documentation. Latency, throughput, failure recovery and security guarantees are not established by this page.

Reasoning

The guide's architecture explains why a gateway can help an organization manage access: individual credentials identify developers while provider credentials remain at the gateway. A stable Anthropic-format endpoint also provides a place to change provider routing centrally.

Whether this arrangement benefits a particular team depends on its identity system, automation needs, provider billing and existing infrastructure. The documentation supports that architectural reasoning, but supplies no benchmark, deployment result or measured administrative benefit.

Alternatives

The page's main comparison is Claude apps gateway versus an existing LLM or API gateway. The bundled option offers integrated sign-in, group policies and forwarding behavior aligned with Claude Code releases. An existing gateway may fit infrastructure already in use, but its compatibility rules require maintenance.

Direct provider configuration is the documented path for CI that cannot complete the bundled gateway's sign-in. The page does not compare named third-party gateway products, their prices or their reliability, so it cannot establish which external product is preferable.

Evidence

The evidence is the complete captured text of [https://code.claude.com/docs/en/gateways.md], including its diagram description, gateway comparison, subscription exception and separate-configuration notes. Capability statements are documentation claims.

The captured source revision is sha256:e43db69c4b2a776380ef19c83378a145c85cbf295827387fadfdba09fa5ed130. Linked deployment, protocol, telemetry and availability pages were not included. No installation, authentication, request forwarding or billing behavior was executed or tested.

Access & freshness

Costs

With a gateway-issued credential, forwarded requests are billed to the organization's provider account at API rates. Developers' claude.ai subscriptions are not used or charged for those requests.

The exception is configuring only ANTHROPIC_BASE_URL without a gateway credential. A saved claude.ai login remains the active credential, so subscription billing and usage limits apply, provided the gateway forwards what that arrangement requires. Those forwarding details are outside this page.

Numeric API rates, gateway charges, infrastructure costs and operating costs are unknown. Inclusion of the gateway in the claude binary does not establish a zero total cost, and the page provides no measured savings.

Rights

The page does not state a license for its text or for the bundled gateway, or establish redistribution permissions. Describing the gateway as self-hosted and included in the claude binary does not establish open-source licensing.

Provider contract terms, data retention commitments and permitted-use conditions are not specified here. Those rights and obligations remain unknown from the selected evidence.

Freshness

The documentation snapshot was captured on 2026-11-15 at 01:56:09.298 UTC. The page contains no publication date, update date, minimum Claude Code version or specific gateway release number.

Compatibility is release-sensitive: the page says external forwarding rules must track evolving beta headers and request fields, while the bundled gateway releases alongside the CLI. Compatibility with any particular installed version remains unverified.

Actions

Before adopting this architecture, decide which provider account should pay, whether corporate browser sign-in fits the intended machines, and whether CI needs a separate direct-provider configuration. Choose the bundled gateway or an existing gateway according to those requirements.

Use the relevant deployment or compatibility guide to establish exact prerequisites. Confirm the installed client's request compatibility, gateway-session feature differences, group policies, telemetry destinations and required network access. Obtain current provider rates and applicable terms separately; this page does not establish them.

Evidence for this report

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