Skip to content
BENIBIX Learn

ANTHROPIC_CUSTOM_HEADERS

AI⌨️ Claude CodeConfiguration

Also known as ANTHROPIC_CUSTOM_HEADERS environment variable

It adds your own headers to each request.

Think of it like

It is like you add a note to the top of each letter.

Example

Jack's gateway splits the bill by team. Each team sets ANTHROPIC_CUSTOM_HEADERS to X-Team and its name, and the bill comes out right.

Why it matters

A gateway can sort, bill and allow requests by facts only you know.

Definition

ANTHROPIC_CUSTOM_HEADERS adds your own headers to every API request. Write each one as Name: Value, with a new line between them. A gateway can read them, for example to know which team sent the request. A character a header cannot carry, such as a curly quote, makes the request fail. It needs version 2.1.227 or later.

Example code

bash
export ANTHROPIC_CUSTOM_HEADERS="X-Team: payments"
claude
Tag each request with your team.
Your headers ride on each request the whole way.

Common mistake

Copying a header from a chat app. A curly quote in it makes every request fail.

Key takeaways

  1. 1
    Name: Value. One per line.
  2. 2
    Every request. The gateway reads it.
  3. 3
    Plain characters. Or the request fails.