Problem: AI API calls have real costs (per-token pricing). Without tracking, it's impossible to know how much the AI feature costs, which users consume the most, or whether pricing tiers are sustainable.
Solution: Log every AI API call with token counts and estimated costs. Provide an admin dashboard to view usage patterns, costs per user, and aggregate statistics.
Not included: User-facing usage dashboards or billing integration. This is admin-only analytics.
Expected behavior:
Current state: Token/cost logging exists but the admin dashboard is minimal.
Admin dashboard only — not visible to regular users.
TODO: Design the admin analytics dashboard — charts, tables, filters
Logging: Each /api/ask call captures token usage from the Anthropic API response.
Data storage:
TODO: Verify if logs go to a DB table or just server logs
Admin route:
TODO: Check if
/adminhas AI cost analytics
Files:
apps/web/src/routes/api/ask/+server.ts — token loggingapps/web/src/routes/(app)/admin/+page.svelte — admin dashboard (if exists)Current: IN_PROGRESS Milestone: v3 Priority: Medium — important for business sustainability
What's done:
What remains:
Dependencies: