Skip to main content

A2A — Usage

The usage method namespace provides programmatic access to token consumption and request statistics. Use it to build usage dashboards, enforce budget alerts, or generate cost reports for internal chargebacks.

All usage data is real-time accurate to within a few seconds of the request completing.

Methods

usage.summary

Returns aggregate usage for the workspace for a given time period.

Params:

ParamTypeRequiredDescription
fromISO 8601 dateyesStart of the reporting period
toISO 8601 dateyesEnd of the reporting period
namespace_idstringnoFilter to a single namespace

Returns:

{
"period_from": "2026-07-01T00:00:00Z",
"period_to": "2026-07-21T23:59:59Z",
"total_requests": 14823,
"total_prompt_tokens": 9821034,
"total_completion_tokens": 1234567,
"total_cost_credits": 4521
}

usage.breakdown

Returns usage broken down by model, namespace, or API key. Specify group_by to control the aggregation dimension.

Params:

ParamTypeRequiredDescription
fromISO 8601 dateyesStart of the reporting period
toISO 8601 dateyesEnd of the reporting period
group_bystringyes"model", "namespace", or "key"
limitintegernoMax rows to return. Default 100.

usage.timeseries

Returns daily usage totals for a period, useful for charting.

Params: from, to, and optional namespace_id.

Returns: Array of daily buckets with date, requests, prompt_tokens, completion_tokens, cost_credits.

Coming soon

Hourly granularity and per-request log streaming via Server-Sent Events are being added to the usage API.