mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-12-06 00:05:30 +00:00
Kimi For Coding now ships two response shapes: - Legacy plans: limits[].detail (5h counts) + top-level usage (weekly pool). - New plans (Go/Plus/Pro): usages.limit_5h / limit_7d / limit_month_total / limit_month_code reported as used_ratio (0-1) with reset_time. There is no top-level usage block, so the monthly pool was never parsed and the monthly quota was invisible in the account list. parseKimiUsageTiers now understands usages.* (used_ratio x100, monthly takes the larger of total/code with the earlier reset), keeps the legacy usage block as a fallback, and prefers usages.limit_7d over legacy weekly counts so weekly is not emitted twice. Snapshot writes also stopped clearing windows that disappear from the response: extra updates are JSONB merges, so not writing a window keeps its previous value forever. After a plan change the old weekly percentage froze (observed 13 days) and the account page kept showing an expired 7D window. Callers now write explicit nils for absent 5h/weekly/monthly windows. cnQuotaHasMonthlyWindow includes Kimi so threshold pre-pause and the 429 cooldown snapshot consider the monthly window too.