litellm/docs/my-website/docs/proxy/request_headers.md
Krish Dholakia 2340f1b31f
Pass router tags in request headers - x-litellm-tags (#8609)
* feat(litellm_pre_call_utils.py): support `x-litellm-tags` request header

allow tag based routing + spend tracking via request headers

* docs(request_headers.md): document new `x-litellm-tags` for tag based routing and spend tracking

* docs(tag_routing.md): add to docs

* fix(utils.py): only pass str values for openai metadata param

* fix(utils.py): drop non-str values for metadata param to openai

preview-feature, otel span was being sent in
2025-02-18 08:26:22 -08:00

924 B

Request Headers

Special headers that are supported by LiteLLM.

LiteLLM Headers

x-litellm-timeout Optional[float]: The timeout for the request in seconds.

x-litellm-enable-message-redaction: Optional[bool]: Don't log the message content to logging integrations. Just track spend. Learn More

x-litellm-tags: Optional[str]: A comma separated list (e.g. tag1,tag2,tag3) of tags to use for tag-based routing OR spend-tracking.

Anthropic Headers

anthropic-version Optional[str]: The version of the Anthropic API to use.
anthropic-beta Optional[str]: The beta version of the Anthropic API to use.

OpenAI Headers

openai-organization Optional[str]: The organization to use for the OpenAI API. (currently needs to be enabled via general_settings::forward_openai_org_id: true)