← Claude Docs

Run Claude Code through a gateway - Claude Code Docs

Claude Docs · July 2, 2026
A gateway is a proxy that sits between Claude Code and a model provider, forwarding API traffic while the organization maintains control over authentication, usage tracking, budgets, and audit logging. Claude Code includes Claude apps gateway as a self-hosted gateway option within the claude binary, and it also works with existing LLM gateways that organizations already operate. When developers use a gateway-issued credential, their usage is billed to the organization's provider account at API rates rather than being charged against their claude.ai subscriptions.

Detailed Analysis

Anthropic's Claude Code documentation update introduces detailed guidance on running Claude Code through a gateway architecture, formalizing how enterprise organizations can mediate access between developers and AI model providers. At its core, the gateway pattern inserts an organizational proxy between individual developer instances of Claude Code and the underlying model provider—whether that's Anthropic's API directly, Amazon Bedrock, Google Cloud's Agent Platform, or Microsoft Foundry. Rather than developers holding provider credentials directly, they authenticate to a gateway using organization-issued credentials, while the gateway itself holds and manages the actual provider credential. This separation allows centralized control over authentication, usage tracking, budget enforcement, and audit logging—capabilities that matter enormously to enterprises deploying AI coding tools at scale.

The documentation highlights two paths: Anthropic's own "Claude apps gateway," which ships embedded in the Claude binary, or integration with a third-party LLM gateway an organization already operates. The built-in option offers meaningful advantages for enterprises already invested in identity infrastructure—it supports SSO login through corporate identity providers, enforces model access and settings policies by IdP group, and emits OpenTelemetry usage metrics compatible with existing observability stacks. Critically, because Anthropic builds and tests this gateway alongside each Claude Code release, it automatically stays synchronized with the headers and request fields the CLI sends, sidestepping the maintenance burden that comes with keeping a separately-maintained gateway compatible with an evolving product. This is a notable design choice: Anthropic is effectively reducing friction for enterprise adoption by ensuring its own infrastructure requires zero manual updates as Claude Code evolves, while explicitly declining to endorse or support routing through gateways to non-Claude models—reinforcing platform lock-in even as it accommodates enterprise infrastructure preferences.

This gateway model matters because it addresses a core tension in enterprise AI adoption: individual developer productivity tools versus organizational governance and cost control. As coding agents like Claude Code become embedded in day-to-day software engineering workflows, IT and security teams need mechanisms to audit usage, enforce budgets, and prevent credential sprawl—problems that mirror earlier enterprise SaaS and API management challenges but are now acute given the potentially high per-token costs of frontier model usage at scale. The documentation's careful distinction between subscription billing (claude.ai personal accounts) and gateway-routed API billing is particularly telling: when developers authenticate through a gateway, their personal subscriptions are bypassed entirely, and usage is billed at API rates to the organization's provider account instead. This reflects an underlying shift from consumer-style subscription pricing toward metered enterprise consumption—a pattern common across SaaS-to-enterprise transitions.

The piece also reveals structural limitations worth noting, particularly around CI/CD workflows: because Claude apps gateway relies on browser-based SSO with no service-token flow, automated pipelines lacking a human to complete sign-in cannot authenticate through it, requiring separate configuration against the provider directly. This gap points to a broader challenge in agentic AI tooling—balancing human-centric identity and access management with the increasingly autonomous, non-interactive contexts (CI pipelines, background agents, SDK-driven automation) in which these tools now operate. As Anthropic and competitors like OpenAI and Google push agentic coding tools deeper into enterprise software development lifecycles, this kind of infrastructure documentation signals a maturing product category—one where the technical capability of the AI model is only part of the equation, and enterprise-grade access control, billing transparency, and observability integration are becoming just as essential to adoption as raw model performance.

Read original article →