---
title: "Get Billing Usage By Agent"
method: GET
path: "/api/billing/usage/by-agent"
tags: ["billing"]
---

# Get Billing Usage By Agent

`GET /api/billing/usage/by-agent`

## Request

- Base URL: `https://api.tintin-x.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.tintin-x.com/api/billing/usage/by-agent`
- Auth: HTTP bearer

Per-agent credits rollup over the last N days (1-365).

Powers the "Usage by agent" summary in tintin-app's billing panel —
replaces the old per-transaction list. Cached 10 minutes; per-user
rate-limited (same bucket as `/agents/{id}/usage/*`).

## Query parameters

- `days` integer

## Response `200`

Successful Response

- BillingUsageByAgentResponse
  - `days` integer, required
  - `total_credits_cents` integer, required
  - `agents` AgentRollupRow[], required
    - `agent_id` string, uuid, required
    - `agent_name` string, required
    - `credits_cents` integer, required
    - `calls` integer, required
  - `generated_at` string, date-time, required
  - `cache_hit` boolean, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/tintin-x/apis/tintin-api.md) · [All operations](https://skmtc.dev/tintin-x/apis/tintin-api/llms.txt) · [OpenAPI document](https://skmtc.dev/tintin-x/apis/tintin-api/revisions/8839a8d0a66c?raw)
