Fix a 402 error (quota exhausted)
A 402 with the code quota_exhausted means neither your plan’s token allowance nor your credit can pay for the request. The error’s limit field tells you which limit stopped it, and that decides the fix.
Read the error
{
"error": {
"type": "insufficient_quota",
"code": "quota_exhausted",
"message": "You've hit your weekly usage limit. It resets at 2026-10-20T00:00:00.000Z. Enable usage credits or upgrade your plan to keep going.",
"param": null,
"limit": "weekly",
"resets_at": "2026-10-20T00:00:00.000Z",
"request_id": "req_6f1c2a9e0b7d4c3a8e5f1b2d"
}
}Fix by limit value
limit | What happened | What to do |
|---|---|---|
session | The rolling five-hour window (25% of your monthly allowance) is full | Wait until resets_at, or turn on usage credits |
weekly | The weekly window (60% of the monthly allowance) is full | Wait until resets_at, or turn on usage credits |
monthly | The whole monthly allowance is used | Wait for the new month, turn on usage credits, or upgrade |
spend_limit | An organization, member or group spend limit was reached | An admin raises the limit in Billing → Spend limits, or wait for the new month |
no_credits | Your credit balance can’t cover the request | Buy credit on the Recharge page or set up auto-reload |
Turn on usage credits
On paid plans, credits let work continue past the plan windows at your plan’s overage rate. They only take over when usage credits are enabled and a card is on file. See How usage limits work.
The Free plan has no overage and can’t use the API at all.
If usage can’t be checked at that moment, you get 503 usage_check_unavailable with a Retry-After header instead of a 402. That one is safe to retry after a few seconds.
Don’t retry in a loop
The answer won’t change until the window reopens or you add credit. Retrying straight away only adds load. Have your code stop and alert you, or wait until resets_at.
To avoid surprises, keep auto-reload on and watch the bars on the Usage Limits page. They turn amber at 80%.