client.cost
client.cost — the cost operations.
On AsyncKindgi every method is the same, awaited.
client.cost.aggregate()
Section titled “client.cost.aggregate()”aggregate( *, group_by: str, from_: str | None = None, to: str | None = None, category: str | None = None, provider_id: str | None = None, agent_id: str | None = None, run_id: str | None = None, conversation_id: str | None = None, scope_kind: Literal['tenant', 'org', 'project'] | None = None, scope_id: str | None = None, inherit: bool | None = None, timeout: float | None = None,) -> CostAggregateResultAggregate cost across a time window. GET /v1/cost/aggregate
Primary consumer path for dashboards. groupBy is required (comma-separated dimensions from the closed set); time range is required (both from and to, or both omitted for the default last-30-days window echoed back in timeRange). Filters compose on top of the time window. ?scopeKind + ?scopeId + ?inherit narrow the aggregate to a specific scope — reconciles byte-for-byte with the same scoped /records list.