Key Info
LiteLLM now exposes the exact cost of a Responses API call directly in the response body via the usage.cost field, so applications can read spend without parsing headers or querying logs.
Highlights
- Send a non-streaming request to
/v1/responsesthrough LiteLLM. - Read
usage.costfrom the response body to get exact spend. - The value matches the
x-litellm-response-costheader and spend logs. - Implemented in a merged PR; details available in the linked PR.