Usage

What the account has spent, and what it is allowed to spend — for your own dashboard, your own bill, your own alert.

Reading it

GET /v1/usage, with optional from and to.

bash
curl https://api.tigerbase.cloud/v1/usage \
  -H "Authorization: Bearer $TIGERBASE_KEY"
200 OK
{
  "period": {
    "from": "2026-10-12T00:00:00.000Z",
    "to": "2026-10-31T10:15:00.000Z",
    "resetsAt": "2026-11-12T00:00:00.000Z"
  },
  "totals": {
    "messages": 830,
    "sessionsStarted": 214,
    "errors": 2,
    "tokensUsed": 412093,
    "platformTokens": 398115,
    "embeddings": 61,
    "documentsIngested": 4,
    "toolCalls": 37,
    "capabilityCalls": 29,
    "handoffs": 6,
    "avgResponseTimeMs": 1840
  },
  "limits": {
    "messagesPerMonth": 1000,
    "messagesUsed": 912,
    "messagesPerMinute": 30,
    "maxConcurrentSessions": null
  },
  "agents": [
    { "publicId": "a1b2c3d4…", "name": "Returns Desk", "messages": 610, "…": "…" }
  ]
}

Warningnull means no ceiling, not zero

These are stored internally with 0 meaning unmetered, which is a fine convention inside one codebase and a trap across an API. The API returns null instead, so you render “no limit” rather than telling a customer they are 830 of 0 and over a limit they do not have.

The range is the billing period

Not the calendar month. They differ for most accounts, and a calendar month would give you a number that disagrees with the monthly limit your customers actually hit. It comes from the same window the limit is measured against.

bash
curl "https://api.tigerbase.cloud/v1/usage?from=2026-10-01&to=2026-10-31T23:59:59Z" \
  -H "Authorization: Bearer $TIGERBASE_KEY"

What comes back

periodfrom, to, and resetsAt — the last only for the default range.
totalsmessages, sessionsStarted, errors, tokensUsed, platformTokens, embeddings, documentsIngested, toolCalls, capabilityCalls, handoffs, avgResponseTimeMs. This key's App only, deleted agents included.
limitsmessagesPerMonth, messagesPerMinute, maxConcurrentSessions, from the App's plan (null for no ceiling), and messagesUsed: the account's messages this period, which is what messagesPerMonth counts.
agentsThe same figures per agent, keyed on publicId — only the agents in this key's App.

Why agents may not add up to totals

A deleted agent's usage is counted in totals and left out of agents, because a row you cannot name is a row you cannot do anything with. Agents in another App on the same account are in neither: a key sees its own App. They do count towards limits.messagesUsed, because the monthly ceiling is the account's.

A date it cannot read is refused

typescript
try {
  await tigerbase.usage({ from: "last tuesday" });
} catch (error) {
  error.code; // "bad_request" — the message names the field
}

NoteRefused rather than ignored, on purpose

A caller who sends an unreadable date, gets a full period back and reports those numbers has been given a wrong answer with no way to notice. Both from and to take a Date or an ISO string, and to must be after from.

An alert worth having

jobs/usage-alert.ts
import { tigerbase } from "@/lib/tigerbase";

/** Warn before the agent stops answering, not after. */
export async function checkAllowance() {
  const { limits, period } = await tigerbase.usage();
  const ceiling = limits.messagesPerMonth;

  // No ceiling means nothing to warn about. Treating null as 0 here is
  // how an unmetered account gets paged every hour.
  if (!ceiling) return;

  const used = limits.messagesUsed / ceiling;
  if (used > 0.8) {
    await notify(
      `${Math.round(used * 100)}% of this period's messages used. ` +
        `Resets ${new Date(period.resetsAt!).toDateString()}.`,
    );
  }
}

TipWhy 80% and not 100%

At 100% the agent has already stopped answering and somebody's customers are already seeing it. The point of reading these numbers from your own system is to act before that.

Scope

Needs read.