Usage and cost for a single request
Looks up one request’s usage row for exact per-request cost
attribution — the per-turn complement to the whole-key aggregate
/v1/flex/usage returns.
request_id is the value of the x-litellm-call-id response header
on the original inference call (not the id field in the
response body). Capture that header per call, then join it here.
The lookup is scoped to the calling key: a request made with a
different key returns the same 404 as an id that does not exist.
Rows are written when a request completes, so a lookup immediately
after the call may briefly 404 — retry after a few seconds.
total_spend is computed through the same pricing path as the
/v1/flex/usage aggregates, so per-request values sum to the totals
you reconcile against. Only LiteLLM-routed (text) requests carry a
call id, so rows always have modality=text.
Authorizations
Virtual API key. Create one from the
FlexAI dashboard. Pass as
Authorization: Bearer sk-xxxx.
Path Parameters
The x-litellm-call-id header value from the original response.
Response
Successful response
usage.request USD Raw ledger id — the served routing target; not stable across packaging changes.
Stable catalog id; use this to group and reconcile per-model.
success, failure, or unknown. Failed requests
typically report zero tokens and $0 spend.
text