Skip to content

feat(console): Usage Cost tab + DeepSeek list-price equiv (from #336) - #387

Merged
caigee-cmd merged 2 commits into
mainfrom
fix/pr-336-usage-cost
Oct 24, 2026
Merged

caigee-cmd merged 2 commits into
mainfrom
fix/pr-336-usage-cost

Conversation

@caigee-cmd

Copy link
Copy Markdown
Owner

Summary

Extracts the token/quota + DeepSeek equivalent-cost UI from external PR #336, layered onto the existing Usage page from #361 instead of replacing it.

  • Stats tab unchanged (by model / account / provider)
  • Cost tab: quota, DeepSeek list-price equivalent (peak/off-peak), stacked chart, per-model table, official price catalog (incl. deepseek-flash)
  • Backend: internal/accounts/model_cost.go, /api/usage/{pricing,cost}, SummarizeModelCosts with the same creditExpr / request_usage_details fallback as feat: usage page, traffic chart metric switch, stats dim/limit, provider log filter #361
  • FE: HeroUI/Tailwind grayscale Studio style; no decorative metric icons; lighter cards; CostChart tooltip aligned with TrafficChart

Architecture notes vs #336

  • Does not replace /usage with a parallel page
  • Does not include WorkBuddy TTFB or log-retention (see sibling PRs)
  • exportWindowHours hardcodes 7d until the retention PR lands; then wire logs.RetentionDays()

Test plan

  • go test ./internal/accounts/ ./internal/api/ ./internal/console/ ./internal/store/
  • npm run lint / npm run sync (frontend build + embedded static)
  • Click Cost tab, switch 24h / 7d / all, verify priced DeepSeek rows and unpriced quota-only models

Supersedes the usage/cost portion of #336. Do not merge #336 as-is.

Extract the token/quota cost UI from #336 as a Cost tab on the existing
Usage page (#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.
@caigee-cmd
caigee-cmd merged commit 1ecd785 into main Oct 24, 2026
6 checks passed
fengye102 pushed a commit to fengye102/cli2api that referenced this pull request Oct 24, 2026
Record attribution for the Usage Cost tab, WorkBuddy TTFB failover, and
configurable log retention that landed via caigee-cmd#385–caigee-cmd#387.

Co-authored-by: YAN <[email protected]>
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