Summary
Follow-up to #522 (anonymous per-feature token-usage tracking). Once LlmUsageEvent rows exist, build read-only admin analytics aggregation endpoints so we can see how users interact with AI features in terms of tokens and cost.
Depends on #522 being merged (the data source).
Motivation
Scope
Out of scope
- Frontend dashboard UI (can be a further follow-up).
- ML model (tracked separately).
Acceptance criteria
Summary
Follow-up to #522 (anonymous per-feature token-usage tracking). Once
LlmUsageEventrows exist, build read-only admin analytics aggregation endpoints so we can see how users interact with AI features in terms of tokens and cost.Depends on #522 being merged (the data source).
Motivation
Scope
LlmUsageEvent(group byfeature,tier,language, day) — sums ofpromptTokens/completionTokens/totalTokens/estimatedCostUsd, plus call counts and success rate./api/v1/admin/llm-usage/*, gated by the existingADMIN_EMAILSallow-list (same pattern as the other/admin/*routes).actorHashat most for cohort sequences — never resolvable back to aUser).ARCHITECTURE.md,README.md,.github/copilot-instructions.md).Out of scope
Acceptance criteria
LlmUsageEvent.actorHashback to a real user.