Endpoints and Headers
An endpoint is a URL path on a server, and a header is a named value that a request carries.
Claude Code calls the model server and a few account servers, and it adds headers to each request.
If you run Claude Code behind a proxy, the proxy must pass anthropic-version and anthropic-beta on without a change.
Base URL variables pick the server, and ANTHROPIC_CUSTOM_HEADERS adds headers. The switches are CLAUDE_CODE_GATEWAY_HINT_HEADERS, CLAUDE_CODE_ATTRIBUTION_HEADER=0, and CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1. The model list is cached in ~/.claude/cache/gateway-models.json.
Model Endpoints
Source: Gateway Compatibility Guide, and Probes for cache_touch.
| Path | Status | What It Does |
|---|---|---|
/ | Documented | Sends the model request. |
/ | Documented | Counts tokens. Without it, Claude Code estimates from the number of characters. |
/ | Undocumented | Claude Code calls it every 30 seconds (10 to 120) to keep the prompt cache warm. It needs a subscriber login and the cache- beta. |
/ | Documented | Lists the models for the / picker, only with CLAUDE_. |
HEAD / | Documented | Warms up the connection. Claude Code skips it when an HTTP proxy or a client certificate is set. |
/ and / | Documented | The Amazon Bedrock format, chosen with ANTHROPIC_. |
: and : | Documented | The Google Cloud Agent Platform format, chosen with ANTHROPIC_. |
Account and Service Endpoints
These paths are strings in the program. The docs do not describe them, except the OpenTelemetry row. The use of a path is a guess from its name.
| Path | Status | Likely Use |
|---|---|---|
/, /, /, / | Undocumented | Sign-in tokens, the profile, plan usage, and account settings. |
/ | Undocumented | The limits of your organization, cached in policy-. |
/, /, / | Undocumented | The metrics switch of the organization, notification settings, and synced skills. |
/ | Undocumented | Event logging by Anthropic. |
/, /, / | Documented | OpenTelemetry export. See Monitoring. |
/, / | Undocumented | Feedback and shared transcripts. |
/, /, /, / | Undocumented | Cloud sessions, routines, and GitHub helpers. |
/, / | Undocumented | The command claude ultrareview. |
/, / | Undocumented | Data for the model picker and the date of first use. |
/ | Undocumented | Voice dictation. |
/, / | Undocumented | Artifacts and Claude Design. |
The program also holds an Anthropic SDK client with paths such as /v1/agents, /v1/skills, /v1/vaults, and /v1/organizations/*.
They belong to the SDK code, and the Claude Code loop does not call them.
The program names these hosts: code.claude.com, claude.ai, claude.com, api.anthropic.com, platform.claude.com, www.anthropic.com, support.claude.com, downloads.claude.ai, and mcp-proxy.anthropic.com.
Request Headers
Source: Gateway Compatibility Guide. Header names are not case-sensitive.
| Header | Status | Meaning |
|---|---|---|
Authorization, x- | Documented | The credential. |
anthropic- | Documented | The API version, 2023-. |
anthropic- | Documented | The list of beta values. See Betas. |
x- | Documented | One value for each session. |
x-, x- | Documented | The subagent that sent the request, and its parent. |
x- | Documented | The kind of request: main, subagent, workflow, compaction, or auxiliary. |
x- | Documented | The kind of agent: Explore, Plan, general-, custom, teammate, or fork. |
x-, x- | Documented | Marks a compaction request, and the first request after one. |
x- | Documented | The run time of the last tool batch, such as Bash=742;Read=9, with at most 32 entries and 4 KB. |
x- | Documented | A random UUID for the user prompt, from 2.. |
anthropic- | Documented | Needed on Claude Platform on AWS. |
ANTHROPIC_ | Documented | An env var for extra headers, one Name: on each line. It is not a header itself. |
x-, anthropic-, X-, X-, x- | Undocumented | Names in the program. No source states their rules. |
The hint headers (x-claude-code-request-class and the next four rows) go out on a direct connection to the Anthropic API.
On a custom base URL they need CLAUDE_CODE_GATEWAY_HINT_HEADERS=1. Setting it to 0 stops them everywhere.
Response Headers Claude Code Reads
| Header | Status | Use |
|---|---|---|
retry- | Documented | A number of seconds. A value above 60 stops the retries unless CLAUDE_ is set. |
x- | Documented | true or false. It is one input to the retry decision. |
anthropic- | Documented | Plan usage and limits for claude. sign-ins. |
content- | Documented | text/, or application/ on Bedrock. |
Attribution Block
The first block of system is a text line that starts with x-anthropic-billing-header:.
The docs say the block holds the client version and a fingerprint of the conversation (Gateway Compatibility Guide).
The field names below come from the program.
| Field | Status | Meaning |
|---|---|---|
cc_ | Undocumented | The client version. |
cc_ | Undocumented | Where Claude Code runs, such as cli, sdk-, or claude-. |
cc_, cc_ | Undocumented | The workload tag (--), and a flag for subagents. |
cc_, cc_, cc_, cc_, cc_ | Undocumented | Request and turn tracking, only on the Anthropic API. |
cc_, cc_, cc_ | Undocumented | Tags for the gateway and the project. |
CLAUDE_CODE_ATTRIBUTION_HEADER=0 removes the block.
The api.anthropic.com server strips it when it is the first and only block of its entry.
Example
Keep the hint headers on a custom gateway and read them there.
export ANTHROPIC_BASE_URL=https://gateway.example.com
export CLAUDE_CODE_GATEWAY_HINT_HEADERS=1
claude -p "hi"
The gateway then sees x-claude-code-request-class: main and the other hint headers on each request.