# ANTHROPIC_CUSTOM_HEADERS

> It adds your own headers to each request.

**Field:** Artificial Intelligence  
**Category:** Claude Code  
**Also known as:** ANTHROPIC_CUSTOM_HEADERS environment variable

## Think of it like

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

## 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

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.

## Example code

```bash
export ANTHROPIC_CUSTOM_HEADERS="X-Team: payments"
claude
```

Tag each request with your team.

## Why it matters

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

## Common mistake

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

## Three principles

- **Name: Value.** One per line.
- **Every request.** The gateway reads it.
- **Plain characters.** Or the request fails.

## Related terms

- [HTTP Header](https://learn.benibix.com/term/infrastructure/http-header)
- [LLM Gateway](https://learn.benibix.com/term/development/llm-gateway)
- [ANTHROPIC_BASE_URL](https://learn.benibix.com/term/ai/anthropic-base-url-variable)

![A request goes out through your proxy and gateway, with the headers and cert you set.](https://learn.benibix.com/diagrams/env-network-path.svg)

---

Source: https://learn.benibix.com/term/ai/anthropic-custom-headers-variable
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-16
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
