Get Ledger Breakdown
Return the active team's usage spend, grouped as requested.
Reads billing_ledger alone, so grouping never joins to requests and agent spend can carry no prompt content (ENG-4722). Usage entries only: top-ups, grants and adjustments are wallet movements rather than work, and are what /balance accounts for.
Args: start: Inclusive lower bound on entry time. end: Exclusive upper bound on entry time. auth: Authenticated caller; the active billing team is read from scope. dimension: Grouping dimensions; at least one, or supply a grain. grain: Optional UTC day/month bucketing. project_id: Optional project filter. experiment_id: Optional experiment filter.
Returns: One row per group, largest spend first.
Raises: HTTPException: 422 when the window is invalid or no grouping is given.
Query parameters
Inclusive lower bound on entry time (ISO, tz-aware)
Inclusive lower bound on entry time (ISO, tz-aware)
Exclusive upper bound on entry time (ISO, tz-aware)
Exclusive upper bound on entry time (ISO, tz-aware)
Repeatable: category, model, provider, project, experiment
Repeatable: category, model, provider, project, experiment
Bucket by UTC day or month
Bucket by UTC day or month
Restrict to one project
Restrict to one project
Restrict to one experiment
Restrict to one experiment
Response
Successful Response