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 = {}; - // 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,