Skip to content

[Feature Request] Track weekly quota utilization and wasted quota per auth file #258

Description

@dsjzazs

Feature Request

Add lightweight weekly quota utilization and wasted quota statistics per authentication file.

Motivation

For users managing multiple authentication files, it is useful to know not only the current quota percentage, but also how much quota was left unused before each weekly reset.

For example, if an auth file has 23% weekly quota remaining right before reset, and then returns to 100% after reset, that means:

  • Weekly utilization: 77%
  • Wasted / unused quota before reset: 23%

This would help users understand which auth files are underused, which ones are heavily used, and whether their current routing / account allocation strategy is wasting weekly quota.

Proposed Behavior

For each auth file, record lightweight historical observations of the weekly remaining quota percentage.

When the system detects that the weekly quota has recovered from a non-full value back to nearly full, treat it as a weekly reset event.

Example:

previous weekly remaining: 23%
current weekly remaining: 100%

Then generate a reset summary:

wasted quota before reset: 23%
weekly utilization: 77%

Suggested Metrics

For each authentication file, display metrics such as:

  • Current weekly quota remaining percentage
  • Last observed quota remaining before weekly reset
  • Last weekly utilization percentage
  • Last wasted / unused quota percentage before reset
  • Average weekly utilization over the last N reset cycles
  • Average wasted quota percentage over the last N reset cycles

Example UI fields:

Auth File: claude-account-a
Current weekly quota: 100%
Last reset-before remaining: 23%
Last weekly utilization: 77%
Last wasted quota: 23%
Average utilization over last 4 weeks: 81%

Why This Is Useful

This would make it clear:

  • Which auth files are consistently underused before reset
  • Which auth files are close to fully utilized every week
  • Whether multiple auth files are balanced effectively
  • Whether users should adjust routing priorities or account weights
  • How much weekly quota is effectively being wasted

This is especially useful for a usage/statistics-oriented companion service, because it provides a higher-level efficiency metric rather than only raw request/token usage.

Implementation Notes

This does not need to store full request-level details.

A lightweight implementation could store only quota snapshots and reset summaries, for example:

{
  "authFileId": "claude-account-a",
  "quotaType": "weekly",
  "beforeResetRemainingPercent": 23,
  "afterResetObservedPercent": 100,
  "utilizationPercent": 77,
  "wastedPercent": 23,
  "detectedAt": "2026-06-30T00:00:00Z"
}

To avoid false positives, reset detection could use a threshold instead of requiring exactly 100%, for example:

current remaining >= 95%
previous remaining <= 90%
current remaining - previous remaining >= 20%

If the system cannot observe the exact moment before reset, it can still use the last observed value before reset and mark the result as an approximation.

Goal

The goal is to provide a clear per-auth-file view of weekly quota utilization and wasted quota before reset, so users can optimize how they distribute traffic across multiple auth files and reduce unused weekly quota.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions