Skip to main content
Use these methods to read org-wide usage totals. They are useful for dashboards, quota checks, and billing reports.
These helpers are read-only. They do not count toward your quota.

tex.usage.today()

int
Tokens you’ve sent us today (UTC day).
int
Tokens we’ve returned to you today.
int
Daily ingress cap. 1_000_000 on the free tier.
int
Daily egress cap. 5_000_000 on the free tier.
str
Always "day_utc".
str
ISO 8601 timestamp at 00:00 UTC today.
str
ISO 8601 timestamp at 00:00 UTC tomorrow.

tex.usage.summary(month=None)

Calendar-month rollup, UTC.
str | None
"YYYY-MM". Omitted = current month.
str
Always "month".
str
ISO 8601 timestamp of the first second of the month.
str
ISO 8601 timestamp of the first second of the next month.
int
Total ingress tokens for the month.
int
Total egress tokens for the month.

Patterns

  • Per-response usage is on every remember and recall:
  • Quota-aware routing - turn off non-essential memory paths past 90%:
    Cache usage.today() on your side for up to 60 seconds. Use it as a soft guard, not a strict limiter.
  • Usage charts - call summary(month="YYYY-MM") for each of the last 6 months and render the results in your charting library.

Next: Handle errors

Every exception class and how to handle it.