Skip to main content
An LLM gateway is a proxy your organization runs between Claude Code and the model provider. When your organization uses one, Claude Code authenticates to the gateway with a credential your organization issues instead of your personal claude.ai login. This page is for developers running Claude Code through a gateway their organization operates. It covers two paths: checking whether your administrator already configured it for you, and configuring it yourself when they haven’t.

Check for an existing configuration

Administrators can distribute the gateway address and credential through managed settings, device management, or an apiKeyHelper, so Claude Code picks them up at startup with nothing for you to set. To check whether your organization already did this:
1

Start Claude Code

Run claude. If it opens to the login screen instead of a session, no gateway credential was distributed; configure it yourself below.
2

Check the Status tab

If Claude Code started a session without showing the login screen, run /status, which opens on the Status tab, and check two lines:
  • Anthropic base URL: this line only appears when a gateway address is set. If it isn’t there, Claude Code isn’t pointed at the gateway; configure it yourself below.
  • Auth token or API key: a line naming ANTHROPIC_AUTH_TOKEN, ANTHROPIC_API_KEY, or an apiKeyHelper confirms a gateway credential is active. A Login method line naming a claude.ai account instead means the credential wasn’t distributed; set it yourself.
3

Send a test message

Close the /status menu and send any prompt in Claude Code. A normal response from Claude, with no error, confirms the gateway connection works.
If both lines in the /status menu look right but the message to Claude fails, see the troubleshooting table.

Configure Claude Code yourself

To configure Claude Code for the gateway yourself, you need from your gateway team:
  • The gateway’s base URL
  • A credential: a key or token string, or a command that fetches one
The sections below cover the configuration in order:
  • Set the credential variable and set the base URL: the two variables every gateway connection needs
  • Verify the connection: confirm it works before persisting anything
  • Configure each surface: if you are using a surface besides the Claude Code CLI, such as VS Code, see how to configure it with your gateway credentials
  • Additional configuration: variables some gateways need beyond the base URL and credential, such as a custom header, a credential helper, model discovery, a provider-format base URL, or turning off traffic outside the gateway path. Set these only if your administrator named them or your network restricts egress

Set the credential variable

To authenticate Claude Code to the gateway, set your credential in an environment variable. Which variable depends on what your gateway team told you: If you weren’t told which kind, use