Budget & Spend Tracking

Get Spend Capture Rate

Compare the spend LiteLLM captured for a provider against that provider's own bill, per UTC day.

Admin only. Reads the provider's billing API with the billing credential set on the proxy (OpenAI: OPENAI_ADMIN_KEY) and sums LiteLLM_DailyUserSpend for the same days.

Example:

curl -H "Authorization: Bearer $LITELLM_MASTER_KEY"       "http://localhost:4000/spend/capture_rate?provider=openai&start_date=2026-09-17&end_date=2026-09-23"
get/spend/capture_rate

Request

  • Base URL: https://docs.litellm.com.cn (the document declares no server; this is the origin it was published from)
  • URL: https://docs.litellm.com.cn/spend/capture_rate
  • Auth: API key in header x-litellm-api-key

Query parameters

start_datestring date required

First UTC day of the range, YYYY-MM-DD

end_datestring date required

Last UTC day of the range, YYYY-MM-DD, inclusive

provider'openai'

Provider whose bill to compare against; needs OPENAI_ADMIN_KEY set on the proxy

thresholdnumber

Ratio under which the report flags below_threshold

project_idsstring[] nullable

Scope the OpenAI bill to these project ids; omit to compare against the whole organization. Captured spend is never scoped, so pass every project LiteLLM's OpenAI keys belong to

Response

Successful Response

provider'openai' required
start_datestring required
end_datestring required
captured_spendnumber required
provider_spendnumber required
capture_ratenumber nullable required
thresholdnumber required
below_thresholdboolean required

Changes

No recorded changes to this operation across all 1 revision of this API.