Gets aggregated per-model token usage for a specific agent revision or all revisions.
Returns one row per `(provider, model)` pair seen in this revision's executions, summing input tokens, output tokens, and call counts so callers can rank model spend and detect drift after a revision change. Pass `*` as the revision to aggregate across every revision the agent has ever run, which is useful for top-of-funnel dashboards; pass a specific revision number to attribute usage to one deployed version. Pair with the revision cost endpoints for dollar-cost breakdowns rather than raw tokens. Without `from` and `to` the rollup covers all time; with either it covers that window, read on the same timestamps as the cost timeseries (a missing `from` is 30 days before `to`), so the two reconcile over the same range. Days kept only as daily summaries come back as `summarized` rows with no revision (all-revisions reads only).
Authorization
Bearer JWT Authorization header using the Bearer scheme. Enter 'Bearer' [space] and then your token.
In: header
Path Parameters
The unique identifier of the agent.
The revision number, or * to aggregate across all revisions.
The tenant identifier
Query Parameters
Optional environment slug to filter usages by.
Execution origin to roll up. Defaults to PRODUCTION — existing
dashboards see no behavior change after draft tests start landing in
the cost ledger. Pass TEST for developer test usage.
"PRODUCTION""UNSPECIFIED" | "PRODUCTION" | "TEST"Optional window start as Unix milliseconds (inclusive).
int64Optional window end as Unix milliseconds (exclusive). Defaults to now when a window is requested.
int64Response Body
curl -X GET "https://api.fruxon.com/v1/tenants/string/agents/string/revisions/string/modelUsages"[
{
"revision": 0,
"modelId": "string",
"providerId": "string",
"inputTokens": 0,
"outputTokens": 0,
"cachedTokens": 0,
"cacheWriteTokens": 0,
"thinkingTokens": 0,
"webSearchCalls": 0,
"executionCount": 0,
"inputCost": 0,
"outputCost": 0,
"webSearchCost": 0,
"summarized": false,
"totalCost": 0
}
]{
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"instance": "string",
"property1": null,
"property2": null
}Retrieves a specific agent revision.
Returns the immutable snapshot of an agent's configuration at the given revision number: its `definition` (provider, prompts, tools and capability configs), the input parameter schema, the integration slots and contacts it declares, and its authorship. The body reads back in the same vocabulary the authoring endpoints accept, so a revision fetched here can be edited and posted to `PUT .../draft` or `POST .../revisions` unchanged. The revision identifier may be a numeric version, or pass `draft` to inspect the in-progress unsaved revision being edited. Deployed revisions are read-only; use the create-agent-revisions endpoints to fork a new draft and deploy it with `POST .../revisions/{revision}:deploy`.
Gets the execution parameters for an agent.
Returns the parameters required to execute the agent, including input schema, default values, and validation rules.