---
title: "Get a usage report – Superbot API"
canonical_url: "https://superbot.gg/developers/usage/getUsageReport"
summary: "The account’s usage across every key in hourly or daily UTC buckets, grouped by any mix of key, model, lane, role, session and team, and narrowed by any filter. A person key reads its own person’s usage here, never the account’s."
---

> Markdown of https://superbot.gg/developers/usage/getUsageReport. Site index: /llms.txt.

# Get a usage report

`GET /v1/usage/report`

The account’s usage across every key in hourly or daily UTC buckets, grouped by any mix of key, model, lane, role, session and team, and narrowed by any filter. A person key reads its own person’s usage here, never the account’s.

- Operation id: `getUsageReport`
- Group: [Usage & spend](https://superbot.gg/developers/usage.md)
- Auth: A caller key holding `usage:read` (`Authorization: Bearer sbc_…` or `x-api-key: sbc_…`), or a signed-in session.
- Scopes: `usage:read`

## Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `starting_at` | string (date-time) | optional | RFC 3339 start, floored to the bucket width. Default: 7 days before `ending_at`. |
| `ending_at` | string (date-time) | optional | RFC 3339 end (exclusive), ceiled to the bucket width. Default: the end of the current bucket. At most 92 days after `starting_at`. |
| `bucket_width` | string | optional | Bucket width; default 1d. One of `1h`, `1d`. |
| `group_by` | string \| array of string | optional | Split each bucket by these dimensions: api_key_id, model, lane, role, session_id, team_id. Repeat the parameter or pass a comma list. |
| `api_key_ids` | string \| array of string | optional | Only usage from these caller key ids. Repeat the parameter or pass a comma list. |
| `models` | string \| array of string | optional | Only usage on these model ids. Repeat the parameter or pass a comma list. |
| `lanes` | string \| array of string | optional | Only usage on these lanes: credits, caller_key, byo. Repeat the parameter or pass a comma list. |
| `roles` | string \| array of string | optional | Only usage with these agent roles (chat for a plain turn). Repeat the parameter or pass a comma list. |
| `session_ids` | string \| array of string | optional | Only usage inside these agent runs. Repeat the parameter or pass a comma list. |
| `team_ids` | string \| array of string | optional | Only usage from keys scoped to these teams. Repeat the parameter or pass a comma list. |
| `limit` | integer | optional | Buckets per page. 1h: default 24, max 168. 1d: default 7, max 31. |
| `page` | string | optional | The previous response’s `next_page`. Repeat group_by and the filters with it. |

## Response 200

One page of buckets.

`application/json`: UsageReport.

- `object` (string, required): One of `list`.
- `data` (array of UsageBucket, required)
  - `object` (string, required): One of `bucket`.
  - `starting_at` (string (date-time), required)
  - `ending_at` (string (date-time), required)
  - `results` (array of UsageResult, required)
    - `requests` (integer, required)
    - `tokens_in` (number, required)
    - `tokens_out` (number, required)
    - `cache_read` (number, required)
    - `cache_write` (number, required)
    - `tokens` (number, required): Billed credits.
    - `usd` (number, required)
    - `list_usd` (number, required)
    - `api_key_id` (string | null)
    - `model` (string | null)
    - `lane` (string | null)
    - `role` (string | null)
    - `session_id` (string | null)
    - `team_id` (string | null)
- `has_more` (boolean, required)
- `next_page` (string | null, required): Pass as `page` for the next buckets; null on the last page.

## Errors

Every refusal carries `error`, `message`, `doc_url` and `request_id`; the gateway routes answer in the dialect you dialed.

| Status | Codes | When |
| --- | --- | --- |
| 400 | [`invalid_request`](https://superbot.gg/developers#errors-invalid_request) | The request is malformed or a parameter is invalid; `param` names the field. |
| 401 | [`unauthorized`](https://superbot.gg/developers#errors-unauthorized) | The bearer is missing, malformed or unknown. |
| 403 | [`insufficient_scope`](https://superbot.gg/developers#errors-insufficient_scope) | The key lacks a scope (insufficient_scope), is revoked, or may not call this route. |
| 503 | — | The account store is not ready; retry later. |

## Examples

```sh
curl -sS -X GET "https://superbot.gg/v1/usage/report" \
  -H "Authorization: Bearer $SUPERBOT_API_KEY"
```

```js
const res = await fetch(`https://superbot.gg/v1/usage/report`, {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.SUPERBOT_API_KEY}`,
  },
});
console.log(res.status, await res.json());
```

```python
import os
import requests

res = requests.request(
    "GET",
    "https://superbot.gg/v1/usage/report",
    headers={
        "Authorization": f"Bearer {os.environ['SUPERBOT_API_KEY']}",
    },
)
print(res.status_code, res.json())
```
