Skip to content

Personal usage self-service

Three surfaces, all built from the same PersonalUsageBuilder payload so an editor never sees conflicting numbers between them:

  • "AI usage" profile tab at /user/{uid}/ai-metering-usage. A user can open their own tab with the view own ai metering usage permission; a user holding view ai metering dashboard can open any user's tab as a support/admin drill-down.
  • "My AI usage" account-menu link (/ai-metering/my-usage): redirects the logged-in user straight to their own tab.
  • "Personal AI usage" block: placeable in any region, configurable to show/hide the daily activity chart and the per-feature breakdown. It hides itself automatically on the profile-tab route so the same numbers are never rendered twice on one page. It is cached per user with tags invalidated the moment that user's own usage or quota changes, and its JS additionally lazy-refreshes from a Cache-Control: no-store JSON route so an AI call triggered earlier on the same page view is reflected without a full reload.

Payload (current month only, by design — the daily series depends on raw rows that the retention purge may remove, and the rollup table is month-grained): call count (and the cloud subset), total/cloud/local tokens, cost formatted in the display currency, quota (budget, used, remaining, percentage, threshold, whether a quota is even configured), a status of empty / ok / warning / exceeded / no_quota, a day-by-day token series for the current month, the top 3 "callers" (calling features) by token share plus an "other" bucket, and the list of providers used, ranked by spend (free/local providers rank by token volume instead).

Separately, a site-wide "AI usage summary" block (ai_metering_summary, permission view ai metering dashboard) shows team-wide KPIs for the current month, reusing the same data sources as the two admin dashboards so all three always agree; it caches for up to one hour so "this month" cannot leak across a month boundary on a quiet site.