v5

latestOpenAPI 3.1.02026-08-025631,1012.8 MB
Analytics
Analytics - Usage

Get Usage Summary

Get usage summary for billing.

Aggregates the organization's usage_records — the SAME billing source of truth that feeds daily_burn_rate and monthly invoicing (TG-3003: this was a stub returning usage=[]/total_cost=0.0, so Studio's costs view showed $0 while the burn meter recorded millions of credits/day).

Returns per-operation credit totals for the window with USD derived at the canonical $0.001/credit rate (CREDIT_RATE_USD):

  • usage: one row per operation_type — {operation_type, credits, cost_usd} — biggest spend first. Refund records are negative and net automatically (SP-187).
  • total_credits / total_cost: window totals across operations.

Scoped to the ORGANIZATION (matching the billing meter). Records are only partially namespace-attributed (async engine work carries no namespace), so filtering by namespace would silently under-report; namespace_id is echoed for request context only.

Time Range:

  • If both start_date and end_date are provided, uses that range
  • If neither provided, defaults to last 30 days
  • If only one provided, defaults to now as the other bound

Example:

GET /v1/analytics/usage/summary
GET /v1/analytics/usage/summary?start_date=2025-01-01T00:00:00Z&end_date=2025-01-31T23:59:59Z
get/v1/analytics/usage/summary

Query parameters

start_datestring date-time nullable

Start date (UTC)

Start date (UTC)

end_datestring date-time nullable

End date (UTC)

End date (UTC)

Response

Successful Response

object required