usage

Aggregate run/usage stats

Tenant-scoped run/usage aggregate over a UTC window: a zero-filled timeline, window totals (runs, credits, terminal-only success rate; tokens for internal callers), a by-source split, and, when compare is set, the prior window's totals. Usage is reported in credits (metered COGS → whole credits); the raw dollar figure is never surfaced. start and end are required, timezone-aware ISO-8601 (normalized to UTC); end must be after start and the window must not exceed 366 days (else 422). Requires usage:read.

get/v1/runs-stats

Request

  • Base URL: https://api.patricia.app (the document declares no server; this is the origin it was published from)
  • URL: https://api.patricia.app/v1/runs-stats
  • Auth: HTTP bearer

Query parameters

startstring date-time required

Window start (inclusive). Required, timezone-aware ISO-8601; normalized to UTC.

endstring date-time required

Window end (exclusive). Required, timezone-aware ISO-8601; normalized to UTC.

granularity'day' | 'week' | 'month'

Timeline bucket size. Each bucket's date is its truncated UTC start (week → Monday, month → the 1st).

Timeline bucket size: day (default) / week / month.

compare'previous' | 'same_last_month' | 'same_last_year'

Prior-window selector that populates previous_totals for period-over-period deltas.

Prior-window selector that populates previous_totals (omit for none).

Headers

X-Tenant-Idstring nullable

Response

Successful Response

Changes

No recorded changes to this operation across all 1 revision of this API.