diff --git a/open-sse/services/usage.ts b/open-sse/services/usage.ts index 698e65fd..0e2c5fc9 100644 --- a/open-sse/services/usage.ts +++ b/open-sse/services/usage.ts @@ -703,8 +703,10 @@ async function getAntigravityUsage(accessToken, providerSpecificData) { continue; } - const remainingFraction = toNumber(quotaInfo.remainingFraction, 0); + const rawFraction = toNumber(quotaInfo.remainingFraction, -1); const resetAt = parseResetTime(quotaInfo.resetTime); + // Default to 100% when the API doesn't report a fraction + const remainingFraction = rawFraction < 0 ? 1 : rawFraction; // Models with no resetTime and full remaining are unlimited (e.g. tab-completion models) const isUnlimited = !resetAt && remainingFraction >= 1; const remainingPercentage = remainingFraction * 100;