Account-wide usage across sessions and API keys [read]

Changed on

What the caller spent over a range of UTC days, from both lanes that debit their balance: their sessions (model, capability, connector and runtime calls) and their developer API keys. totals.bySource splits the totals by lane; groups break them down by group_by. A group's key is null where the dimension does not apply to its lane, so the groups always sum to the totals. Per-session detail is GET /sessions/{id}/usage.

get/billing/usage

Request

  • Base URL
    https://api.agentsky.dev/v1
  • URL
    https://api.agentsky.dev/v1/billing/usage
  • Auth
    none declared

Query parameters

fromstring date

First UTC day included, YYYY-MM-DD; defaults to 29 days before today

tostring date

First UTC day excluded, YYYY-MM-DD; defaults to tomorrow. A range spans at most 366 days

source'session' | 'api_key'

Only sessions, or only developer API keys; both when omitted

api_key_idstring

Only this API key's usage

group_by'day' | 'kind' | 'session' | 'api_key'

Response

OK

groupBy'day' | 'kind' | 'session' | 'api_key' required

Changes