This repository was archived by the owner on Jul 24, 2026. It is now read-only.
Implement AI usage API v5 - #47
Merged
Merged
Conversation
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.
📝 变更描述 / Description
将内部 AI Usage 接口升级为 V5:统一香港自然日和自然周统计,移除 V4 的滚动 Token 指标及 Codex 容量,并同时返回公司级与 Key 级的 Token 使用、最终扣费额度、费用占比与请求数。模型排行以消费日志 quota 为唯一成本口径。
🚀 变更类型 / Type of change
🔗 关联任务 / Related Issue
✅ 提交前检查项 / Checklist
📸 运行证明 / Proof of Work
go test -vet=off -p 1 -run "^TestGetAIUsageByUsername" -v ./modelgo test -vet=off -p 1 -run "^TestGetAIUsage" -v ./servicego test -vet=off -p 1 -run "^TestAIUsageRoute" -v ./router三个命令均通过。