Skip to content

readQuotaRetryHint

readQuotaRetryHint(error): QuotaRetryHint | null

Defined in: packages/core/src/core/quotaCooldown.ts:132

Read the quota retry hint from an error thrown by the model call.

Returns { waitMs, perMinute: true } if the error represents a per-minute quota 429 from the Gemini API with a retry wait hint. Returns null if:

  • the error is not a 429 quota exhaustion (e.g. 403 balance refusal, 400 invalid request);
  • the error is not from Gemini API;
  • the quota is per-day (e.g. QuotaFailure quotaId contains PerDay or lacks PerMinute);
  • no wait duration could be parsed;
  • there is no QuotaFailure and the prose wait is past the bound.

unknown

QuotaRetryHint | null