skip to content
superbot.gg

Get a 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.

Part of Usage & spend, 8 operations. The overview covers keys, scopes and errors.

GET /v1/usage/report

A caller key holding usage:read (Authorization: Bearer sbc_… or x-api-key: sbc_…), or a signed-in session.

Operation id getUsageReport in Usage & spend.

Query parameters

  • 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
    4 fields
    • object string required

      One of bucket.

    • starting_at string (date-time) required
    • ending_at string (date-time) required
    • results array of UsageResult required
      14 fields
      • 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

StatusCodeWhat to change
400invalid_request

A parameter or body field is invalid; param names it and issues lists every problem.

401unauthorized

Send a live caller key or session as Authorization: Bearer … or x-api-key. No key yet: create one at /account/api, or sign a user in at /auth.md.

403insufficient_scope

The key lacks the scope in required_scopes; mint a key that holds it.

503

The account store is not ready; retry later.

view .mdopenapi
Request

curl

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

JavaScript

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())
Response

200 One page of buckets.

{
  "object": "list",
  "data": [
    {
      "object": "bucket",
      "starting_at": "2026-09-01T00:00:00Z",
      "ending_at": "2026-09-01T00:00:00Z",
      "results": [
        {}
      ]
    }
  ],
  "has_more": true,
  "next_page": "your-next-page"
}

400 The request is malformed or a parameter is invalid; `param` names the field.

{
  "error": "invalid_request",
  "message": "A parameter or body field is invalid; param names it and issues lists every problem.",
  "doc_url": "https://superbot.gg/developers#errors-invalid_request",
  "request_id": "req_5f1c0a9e2b7d4c3a1e0f9b8d"
}

401 The bearer is missing, malformed or unknown.

{
  "error": "unauthorized",
  "message": "Send a live caller key or session as Authorization: Bearer … or x-api-key. No key yet: create one at /account/api, or sign a user in at /auth.md.",
  "doc_url": "https://superbot.gg/developers#errors-unauthorized",
  "request_id": "req_5f1c0a9e2b7d4c3a1e0f9b8d"
}

403 The key lacks a scope (insufficient_scope), is revoked, or may not call this route.

{
  "error": "insufficient_scope",
  "message": "The key lacks the scope in required_scopes; mint a key that holds it.",
  "doc_url": "https://superbot.gg/developers#errors-insufficient_scope",
  "request_id": "req_5f1c0a9e2b7d4c3a1e0f9b8d"
}

503 The account store is not ready; retry later.

(no body)