From 82df5abcaab297c573bcd9cf3c375884ee0a8fee Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Fri, 14 Aug 2026 17:33:31 -0700 Subject: [PATCH] docs(proxy): document per-component response cost headers --- docs/proxy/response_headers.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/proxy/response_headers.md b/docs/proxy/response_headers.md index 8dcfb9e314..71997d5fde 100644 --- a/docs/proxy/response_headers.md +++ b/docs/proxy/response_headers.md @@ -46,8 +46,16 @@ These headers are useful for clients to understand the current rate limit status | Header | Type | Description | Available on Pass-Through Endpoints | |--------|------|-------------|-------------| | `x-litellm-response-cost` | float | Cost of the API call | | +| `x-litellm-response-cost-input` | float | Uncached input cost component | | +| `x-litellm-response-cost-output` | float | Output cost component, reasoning included | | +| `x-litellm-response-cost-cache-read` | float | Prompt cache read cost component | | +| `x-litellm-response-cost-cache-creation` | float | Prompt cache write cost component | | +| `x-litellm-response-cost-reasoning` | float | Reasoning cost, a subset of the output component | | +| `x-litellm-response-cost-tool-usage` | float | Built-in tool cost component | | | `x-litellm-key-spend` | float | Total spend for the API key | ✅ | +The component headers sum to the total: input + cache read + cache creation + output + tool usage = `x-litellm-response-cost`. Reasoning is already inside output, so exclude it from the sum. The cache and reasoning headers appear only when those costs are nonzero, and component headers appear on non-streaming responses only + ## LiteLLM Specific Headers | Header | Type | Description | Available on Pass-Through Endpoints | |--------|------|-------------|-------------|