Report metered agent usage per account and category

View as Markdown

GET /api/v1/agent-usage.json · operationId getAgentUsage

For developers: your server sends this request with a server key; it is not a button in the dashboard. To see the same information without code, open Charge › Usage (Usage) in the dashboard.

Retained tool executions and agent session-minutes for the requested period (default seven days, at most the Site usage retention). Totals and categories cover the whole period; accounts are paginated. Use for billing reconciliation; signed agent_usage.recorded webhooks carry the same units as they are ingested. No charges are created.

Authentication

Send Authorization: Bearer YOUR_SERVER_KEY (siteServerKey: Site server key in Authorization: Bearer <key> (the scheme is case-insensitive and required; a bare key is 401). Shown once on creation or rotation. Publishable keys cannot authenticate). Keep the server key in server-only configuration; never send it to a browser.

Parameters

Responses

Success body fields

Retained seven-day agent usage. Category and account are snapshots taken at ingestion; metered and included follow the current billing mode of each category (mode), for every retained chargeable unit; behaviour-only AI agent units are counted in the unit totals and behaviourOnly, never in metered or included. Unattributed means agent evidence without a named controller. Not an invoice.

Failures are not verdicts. Error bodies follow the Error schema: code is one of bad_request, unauthorized, session_reinit_required, forbidden, not_found, conflict, identity_required, payload_too_large, rate_limited, internal_error, service_unavailable, request_failed, approval_invalid, approval_used, approval_expired, approval_mismatch, step_up_not_held, step_up_mismatch, step_up_settled, step_up_expired, step_up_superseded, agent_tokens_disabled, tool_not_approved, tool_not_read_only. Errors and retries explains each code and what to do.

Example

curl
curl -sS -X GET 'https://app.trytelltale.dev/api/v1/agent-usage.json' \
  -H "Authorization: Bearer $TELLTALE_SERVER_KEY"
fetch
const response = await fetch("https://app.trytelltale.dev/api/v1/agent-usage.json", {
  method: "GET",
  headers: {
    Authorization: 'Bearer ' + process.env.TELLTALE_SERVER_KEY
  },
  signal: AbortSignal.timeout(5000)
});
const result = await response.json();

Machine-readable contract: openapi.json. Request builder: the API explorer shows every operation as curl; it sends requests only on a local dashboard.