Repository navigation
Replies: 1 comment
|
Same gap on the ACP Registry path I use the GLM Coding Plan through the ACP-registry The quota data is the same as the relay case, and it works live: {"data":{"level":"lite","limits":[
{"type":"CREDIT_LIMIT","unit":3,"number":5,"usage":2000,"currentValue":1450,"percentage":72,"nextResetTime":...},
{"type":"CREDIT_LIMIT","unit":6,"number":1,"usage":10000,"currentValue":5470,"percentage":54,"nextResetTime":...}]},"success":true}
Is this in scope? If yes, which shape would you take:
Happy to implement whichever you prefer. Filed by deepseek-v4.1-flash (OpenCode) in T3 Code. |
Uh oh!
There was an error while loading. Please reload this page.
Problem
A common setup is a Claude provider instance pointed at an Anthropic-compatible relay with
ANTHROPIC_BASE_URL: Z.ai's GLM Coding Plan (api.z.ai/api/anthropic) or Kimi Code (api.kimi.com/coding). These plans have their own 5-hour and weekly quotas, but Usage → Limits shows nothing for them.The Claude CLI's
get_usagereportsrate_limits_available: falseon non-Anthropic backends. The probe therefore recordsunsupported(claudeUsageLimits.ts), and Limits leaves the instance out (usageLimits.ts).I reproduced this on main
a1d9d72aef(web dev build, isolated state). The usage code is unchanged at250e052f44. Both relay instances are enabled and authenticated, but neither appears on Limits:Where the data comes from
Both relays publish quota on a read-only endpoint. Each endpoint accepts the same key the instance already gives the CLI.
GET https://api.kimi.com/coding/v1/usages(Bearer). It returns a weeklyusagesummary pluslimits[]rolling windows (5-hour today). I checked it live today.GET https://api.z.ai/api/monitor/usage/quota/limit(bare key). It returnsdata.limits[]sized byunit/number. Z.ai's own glm-plan-usage plugin uses the same endpoint, and OpenCode: legacy models like other providers, and Z.AI Coding Plan 5-hour and 7-day usage #12964 describes it. My key reached it, but its plan has lapsed (success: false), so I have not seen live Z.ai windows.Smallest scope
ANTHROPIC_BASE_URLis HTTPS on the default port with exactly one of these hosts:api.z.ai,open.bigmodel.cn,dev.bigmodel.cn,api.kimi.com. The driver then reads that relay's quota with the instance'sANTHROPIC_AUTH_TOKENorANTHROPIC_API_KEYand publishes the windows into the existingusageLimitssnapshot.probeFailed, so the last good bars stay.With the change, on the same isolated state (Kimi live; Z.ai reports its lapsed plan as a failed read):
Acceptance criteria
/usage-limits.http, custom ports and unknown relays get no request and no key.Verification plan
--settingsfile is not seen, because the probe reads the instance environment. I also have not seen a relay emit Clauderate_limit_events mid-turn.Relation to other proposals
Decision needed
Do you want quota integrations for third-party Claude relays at all, and if so, is a small per-relay adapter inside the Claude driver acceptable? Or should this only go through a generic user-configured source like #15042?
The implementation, tests and evidence are ready on
relay-usage-zai-20261005andrelay-usage-kimi-20261005. They replay the closed #13586 and #13587 onto current main. I won't open a PR until the direction is agreed.All reactions