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.

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​