Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ The Accounts tab shows each account's Command Code quota, read with the same API
- Credit balances (monthly remaining / purchased / free), plan name and status, billing-period end, and billing-period totals. Every bar and balance is labelled in **plan credits**, the unit the API reports, never in USD.
- Command Code grants a credit pool per plan and scales it per model. On GOAT with DeepSeek V4.1 Flash the pool is 70 credits, split into a 14-credit 5-hour window, a 35-credit weekly window, and the 70-credit monthly allowance — 0.7× the advertised $20 / $50 / $100, so 35 credits/week is roughly $50 of list-price DeepSeek V4.1 Flash usage. A bar at 100% therefore means the plan's real window limit, not a smaller dollar cap. Other plans and models report their own caps; nothing is hardcoded here.
- A per-account **refresh quota** button and a **refresh all** button (which returns immediately and refreshes in the background).
- Each card has a collapsible **Boosted allowance** tracker. Command Code publishes a monthly allowance per model (the "boosted usage" deals), all charged from the same credit pool, so one model's dollars per credit differ from another's. The table shows, per boosted model, its advertised allowance, the multiplier against the plan's credit pool, and the remaining USD allowance derived from the account's remaining credits; the summary line also estimates the 5-hour and weekly windows. The catalog is captured from the Command Code pricing docs (`internal/app/allowances.json`, generated by `go generate ./internal/app`) and embedded in the binary - no network call, no configuration. These USD figures are **estimates** labelled `est`; the credit numbers remain authoritative, and plans without a published per-model table (Provider, Ultra, Max) show no tracker.
- Each card has a collapsible **Boosted allowance** tracker. Command Code publishes a monthly allowance per model (the "boosted usage" deals), all charged from the same credit pool, so one model's dollars per credit differ from another's. The table shows, per boosted model, its advertised allowance, the multiplier against the plan's credit pool, and the remaining USD allowance derived from the account's remaining credits; the summary line also estimates the 5-hour and weekly windows. The catalog is vendored from [commandcode-catalog](https://github.com/peach0x33a/commandcode-catalog) (`internal/app/allowances.json`, refreshed with `go generate ./internal/app`) and embedded in the binary - no network call, no configuration. These USD figures are **estimates** labelled `est`; the credit numbers remain authoritative, and plans without a published per-model table (Provider, Ultra, Max) show no tracker.

Quota refresh runs once shortly after startup and every 5 minutes afterwards; the latest snapshot is cached in `usage.json` so it survives restarts. A failed query keeps the last successful snapshot and only records the error and check time. These endpoints come from [commandcode-usage](https://github.com/MAXeaglet/commandcode-usage); they are unofficial, so the parser tolerates field drift (camelCase or snake_case, epoch seconds / milliseconds / ISO timestamps, flat or `data`-wrapped responses).

Expand Down
2 changes: 1 addition & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ http://localhost:11434/webui
- 余额(月度剩余 / 充值 / 免费)、套餐名称与状态、账期结束时间、账期用量统计。进度条与余额一律按接口返回的「积分」显示,不会写成美元。
- Command Code 按套餐发放积分池,并按模型换算。GOAT 使用 DeepSeek V4.1 Flash 时积分池为 70:5 小时窗口 14、本周窗口 35、月度额度 70,正好是官方宣传的 $20 / $50 / $100 的 0.7 倍。也就是说 35 积分/周约等于 $50 的 DeepSeek V4.1 Flash 原价用量;进度条到 100% 就是套餐真实窗口上限,不是更小的美元上限。其它套餐与模型各自上报自己的上限,这里不做硬编码。
- 账号页提供单账号「刷新额度」与「刷新全部额度」按钮(后者立即返回,后台刷新)。
- 每张卡片带可折叠的**提升额度**跟踪器。Command Code 按模型公布月度额度(官方「提升用量」活动),但都从同一个积分池扣费,因此不同模型的「每积分对应多少美元」并不相同。表格列出每个提升模型的官方额度、相对积分池的倍率,以及按账号剩余积分换算的剩余美元额度;摘要行还给出 5 小时 / 本周窗口的估算。额度表抓取自 Command Code 定价文档并内嵌进二进制(`internal/app/allowances.json`,用 `go generate ./internal/app` 生成),不联网、无需配置。这些美元数字都是**估算**(标 `est`),积分数字仍然权威;Provider、Ultra、Max 等没有公开逐模型额度表的套餐不显示该跟踪器。
- 每张卡片带可折叠的**提升额度**跟踪器。Command Code 按模型公布月度额度(官方「提升用量」活动),但都从同一个积分池扣费,因此不同模型的「每积分对应多少美元」并不相同。表格列出每个提升模型的官方额度、相对积分池的倍率,以及按账号剩余积分换算的剩余美元额度;摘要行还给出 5 小时 / 本周窗口的估算。额度表从 [commandcode-catalog](https://github.com/peach0x33a/commandcode-catalog) 同步到 `internal/app/allowances.json`(用 `go generate ./internal/app` 刷新)并内嵌进二进制,不联网、无需配置。这些美元数字都是**估算**(标 `est`),积分数字仍然权威;Provider、Ultra、Max 等没有公开逐模型额度表的套餐不显示该跟踪器。

额度会在启动后不久自动刷新一次,之后每 5 分钟刷新一次,快照缓存在 `usage.json` 中,重启后仍然保留。查询失败时保留上一次成功的数据,只更新错误与查询时间。接口路径取自
[commandcode-usage](https://github.com/MAXeaglet/commandcode-usage),属未公开接口,解析层兼容字段漂移(camelCase / snake_case、秒 / 毫秒 / ISO 时间、顶层或 `data` 嵌套)。
Expand Down
294 changes: 0 additions & 294 deletions cmd/gen-allowances/main.go

This file was deleted.

77 changes: 0 additions & 77 deletions cmd/gen-allowances/main_test.go

This file was deleted.

Loading
Loading