Skip to main content

API

Claude Code is a client of the Messages API. It sends model requests, counts tokens, and calls a few account and service servers. Each request carries headers and a list of beta values. This section lists them all. If you run Claude Code behind a gateway or proxy, read these pages first, because the gateway must pass some headers on without a change.

At a Glance​

QuestionAnswer
Can you use it?Not directly. Claude Code makes these calls for you. You can watch them with a proxy or a local stub.
Can you change it?✅ Yes. ANTHROPIC_BASE_URL, ANTHROPIC_CUSTOM_HEADERS, ANTHROPIC_BETAS, --betas, and provider variables change the calls.
Can you turn it on or off?CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS, CLAUDE_CODE_GATEWAY_HINT_HEADERS, CLAUDE_CODE_ATTRIBUTION_HEADER=0.
Where does it live?In the program. The gateway guide is the only official source.
StatusDocumented Undocumented

Pages​

PageWhat It Covers
Endpoints and HeadersModel and service paths, request and response headers, the attribution block
BetasEvery anthropic-beta value, when it is sent, and how the list is built

Example​

Send Claude Code through a gateway and pass an extra header.

Use a gateway
export ANTHROPIC_BASE_URL=https://gateway.example.com
export ANTHROPIC_CUSTOM_HEADERS=$'X-Team: docs\nX-Env: staging'
claude

How It Works​