Repository navigation
feat(accounts): estimate Claude OAuth and setup-token window costs - #8900
Merged
Wei-Shaw merged 1 commit intoNov 20, 2026
Merged
Conversation
Contributor
|
All contributors have signed the CLA. ✅ |
Contributor
Author
|
I have read the CLA Document and I hereby sign the CLA |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Claude OAuth 和 setup token 的用量窗口已有使用率,但缺少满额费用估算。这个改动复用现有 OpenAI 7d 的计算方式,在 Claude 通用 5h / 7d 窗口显示“预计总费用”。例如窗口费用 $12、使用率 40%,显示预计总费用 $30。
改动
window_stats.cost * 100 / utilization估算;使用率未知、费用或使用率无效时隐藏。重置时间缺失、窗口过期或推导起点在未来时不补费用统计。7d S/7d F缺少相同模型范围的费用统计,因此不套用全账号费用。估算沿用账号费用口径,包含账号倍率。它表示按当前使用情况推算的满额费用,不代表官方账单;站外使用、采样延迟和模型组合都会影响结果。
验证
git diff --check通过。