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
| Page | What It Covers |
|---|---|
| Endpoints and Headers | Model and service paths, request and response headers, the attribution block |
| Betas | Every anthropic- 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
Related Pages
- Gateway Compatibility Guide is the official page for the model server contract.
- Request and Cache
- Models and Providers
- Network and Proxy Variables