⌨️CLAUDE_CODE_EXTRA_BODY
Also known as CLAUDE_CODE_EXTRA_BODY environment variable
It adds your own fields to each model request.
Think of it like
It is like you put a note in each letter you send.
Example
Lucy's gateway bills by a team tag in the request body. She puts the tag here, and every request carries it.
Why it matters
It lets you use a provider feature the day it ships, with no wait for a new option.
Definition
Example code
bash
export CLAUDE_CODE_EXTRA_BODY='{"metadata":{"user_id":"team-a"}}'
claudeCommon mistake
Key takeaways
- 1JSON object. Merged at the top.
- 2Every model request. Mostly.
- 3For provider extras. With no option.