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:
| Param | Type | Required | Description |
|---|---|---|---|
from | ISO 8601 date | yes | Start of the reporting period |
to | ISO 8601 date | yes | End of the reporting period |
namespace_id | string | no | Filter 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:
| Param | Type | Required | Description |
|---|---|---|---|
from | ISO 8601 date | yes | Start of the reporting period |
to | ISO 8601 date | yes | End of the reporting period |
group_by | string | yes | "model", "namespace", or "key" |
limit | integer | no | Max 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.
Hourly granularity and per-request log streaming via Server-Sent Events are being added to the usage API.