Skip to content

feat(usage): /usage three-lens stats (Task #11)#27

Open
lubobill1990 wants to merge 1 commit into
feat/10-wire-anthropic-messagesfrom
feat/11-usage-route
Open

feat(usage): /usage three-lens stats (Task #11)#27
lubobill1990 wants to merge 1 commit into
feat/10-wire-anthropic-messagesfrom
feat/11-usage-route

Conversation

@lubobill1990
Copy link
Copy Markdown
Collaborator

Refs #11

🤖 Generated with Claude Code

- src/lib/usage-stats.ts: computeUsageStats(filters) builds the three SQL templates (historical/current/timeline) and returns totals + byAccount.byModel.endpoint_breakdown + daily + missing_pricing per design doc 03.
- src/routes/usage/route.ts: parses ?from/?to/?account/?model/?endpoint/?lens; returns { ...primaryAccountQuotaForBackcompat, quota: { byAccount, primary }, stats }.

Tests: historical from snapshots, current uses live pricing, missing_pricing list, endpoint filter.

Refs #11

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant