Repository navigation
feat: usage page, traffic chart metric switch, stats dim/limit, provider log filter - #361
Merged
Merged
Conversation
…filter - store: series buckets carry prompt/completion/cache_read tokens and p50/p95 latency; grouped stats add p95, tokens, cache_write, credits; dim + limit options (SummarizeRequestLogs keeps the 6-row, all-dims contract) - logs API: ?provider= filter (logged provider, else account provider) - stats API: ?dim=model,account,provider&limit=N (max 500) - console: TrafficChart requests/tokens/latency switch; /usage page with sortable tables and shared window controls; provider drill-down; LogsPage provider filter synced with the URL - tests: store usage/series/dim/limit/provider filter, API dim/limit/provider, ParseStatsDims, SPA /usage fallback
caigee-cmd
added a commit
to haocheng23/cli2api
that referenced
this pull request
Oct 23, 2026
- Overview 30s / visibility refresh also quiet-loads usage panels - Converge creditExprNullable + creditExprOrZero (keep caigee-cmd#361 semantics) - Add SummarizeRequestUsage store/API coverage (native/fallback/NULL/realm/1M) - Drop unused usage.Series scan; mark expired-with-remain packs;口径 footnote
2 of 3 tasks
fengye102
pushed a commit
to fengye102/cli2api
that referenced
this pull request
Oct 24, 2026
Extract the token/quota cost UI from caigee-cmd#336 as a Cost tab on the existing Usage page (caigee-cmd#361 Stats kept). Adds pricing catalog (incl. deepseek-flash), /api/usage/{pricing,cost}, SummarizeModelCosts with creditExpr fallback, and CostChart. Does not change log retention or WorkBuddy TTFB.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backend
requestSeries: each bucket addsprompt_tokens,completion_tokens,cache_read_tokens,latency_p50_msandlatency_p95_ms.models/accounts/providers): each row addslatency_p95_ms,prompt_tokens,completion_tokens,cache_read_tokens,cache_write_tokensandcredits.creditsis added tototals, andcache_writetotokens.credits, falling back torequest_usage_details.credit, the same source the request list uses./api/logs/stats?dim=model,account,provider&limit=N:dimlimits which grouped lists are computed. Unknown names are ignored, and an emptydimmeans all three.limitdefaults to 6 and is capped at 500.SummarizeRequestLogsis kept as a wrapper around the newSummarizeRequestLogsWith./api/logs/requests?provider=: matches the same effective provider the ranking groups by (the logged provider, else the account's provider)./usageis added to the route list ininternal/server/router.go.Frontend
FilterToggle) for:/usage, sidebar → Workspace → Usage, PhosphorChartBaricon). It is a separate page rather than an Overview tab because:TablewithallowsSortingandSortableColumnHeader.dim=<tab>&limit=500, so the hard-coded limit of 6 no longer applies there.StatsWindowControlsandlib/statsWindow.tsand shared with the Overview (1h / 24h / 7d / 30d / custom from-to)./logs?provider=. LogsPage has a provider select and syncsproviderwith the URL.logsHrefmoved tolib/logsLink.ts.Tests
store:api: dim/limit over HTTP, the default contract,provideron requests, and the/usageSPA fallback.console:ParseStatsDims.npm testis for the worker), so there are no frontend unit tests. I didn't add a test framework.