billing

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.

get/billing/ledger/breakdown

Query parameters

startstring date-time required

Inclusive lower bound on entry time (ISO, tz-aware)

Inclusive lower bound on entry time (ISO, tz-aware)

endstring date-time required

Exclusive upper bound on entry time (ISO, tz-aware)

Exclusive upper bound on entry time (ISO, tz-aware)

dimensionstring[] nullable

Repeatable: category, model, provider, project, experiment

Repeatable: category, model, provider, project, experiment

grain'day' | 'month' nullable

Bucket by UTC day or month

Bucket by UTC day or month

project_idstring nullable

Restrict to one project

Restrict to one project

experiment_idstring nullable

Restrict to one experiment

Restrict to one experiment

Response

Successful Response

Changes