Skip to content

Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors

fix(usage): correct Claude quota display — utilization = % used, not % remaining (#299)

diegosouzapw46cff2200d37
diff --git a/open-sse/services/usage.ts b/open-sse/services/usage.ts
index e0d3a8bd39..2f945beba9 100644
--- a/open-sse/services/usage.ts
+++ b/open-sse/services/usage.ts
@@ -488,13 +488,14 @@ async function getClaudeUsage(accessToken) {
const data = await oauthResponse.json();
const quotas: Record<string, UsageQuota> = {};
- // utilization = percentage REMAINING (e.g., 90 means 90% remaining, 10% used)
+ // utilization = percentage USED (e.g., 90 means 90% used, 10% remaining)
+ // Confirmed via user report #299: Claude.ai shows 87% used = OmniRoute must show 13% remaining.
const hasUtilization = (window: JsonRecord) =>
window && typeof window === "object" && safePercentage(window.utilization) !== undefined;
const createQuotaObject = (window: JsonRecord) => {
- const remaining = safePercentage(window.utilization) as number;
- const used = 100 - remaining;
+ const used = safePercentage(window.utilization) as number; // utilization = % used
+ const remaining = Math.max(0, 100 - used);
return {
used,
total: 100,