MCPcopy Create free account
hub / github.com/dwgx/WindsurfAPI / isRateLimitedForModel

Function isRateLimitedForModel

src/auth.js:1087–1098  ·  view source on GitHub ↗

* Check if an account is rate-limited for a specific model.

(account, modelKey, now)

Source from the content-addressed store, hash-verified

1085 * Check if an account is rate-limited for a specific model.
1086 */
1087function isRateLimitedForModel(account, modelKey, now) {
1088 // Global rate limit
1089 if (account.rateLimitedUntil && account.rateLimitedUntil > now) return true;
1090 // Per-model rate limit
1091 if (modelKey && account._modelRateLimits) {
1092 const until = account._modelRateLimits[modelKey];
1093 if (until && until > now) return true;
1094 // Clean up expired entries
1095 if (until && until <= now) delete account._modelRateLimits[modelKey];
1096 }
1097 return false;
1098}
1099
1100/**
1101 * Report an error for an API key (increment error count, auto-disable).

Callers 3

getApiKeyFunction · 0.85
acquireAccountByKeyFunction · 0.85
isAllRateLimitedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected