OpenAI API 429: Rate limit or quota exceeded
Error: 429 You exceeded your current quota, please check your plan and billing details.In one sentence: The AI API refused your request because you hit a rate limit or ran out of paid credit.
What it means
HTTP 429 means "too many requests." With OpenAI and similar AI APIs it comes in two flavors: a rate limit (too many requests or tokens per minute, which clears in seconds) and a quota error (no credit left or no billing set up, which won't clear until you pay).
The message tells you which one: "Rate limit reached" is the per-minute kind, while "You exceeded your current quota" means billing.
Common causes
- No payment method or prepaid credit on the API account (a ChatGPT Plus subscription doesn't cover API usage).
- Your monthly spending limit was reached.
- Code calls the API in a loop, on every keystroke, or on every render, so it fires far more requests than you meant.
- Many users at once on a new account with low rate limits.
How to fix it
- For "exceeded your current quota": open the provider's billing page, add credit or a payment method, and check your usage limits. Then wait a few minutes and try again.
- For "rate limit reached": retry after a short delay, doubling the wait each time (exponential backoff), and send fewer, larger requests.
- Look for accidental loops: API calls inside `useEffect` without the right dependencies, or on every input change instead of on submit.
- Call the API from your server, not the browser, so you can limit how often each user can trigger it.
Example
async function withRetry<T>(fn: () => Promise<T>, tries = 4): Promise<T> {
for (let i = 0; ; i++) {
try { return await fn(); }
catch (e: any) {
if (e?.status !== 429 || i >= tries - 1) throw e;
await new Promise(r => setTimeout(r, 1000 * 2 ** i));
}
}
}Prompt to paste into your AI tool
My app gets 429 errors from the OpenAI API. Check whether any code calls the API in a loop or on every render, move calls to the server, and add retry with exponential backoff for rate limits. Do not retry quota errors automatically.Still stuck?
Paste your exact error and code. Get a plain-English explanation free, or the full fix for $5.
Related errors
- TypeError: Cannot read properties of undefined
- CORS error: blocked by CORS policy
- Hydration failed: server HTML didn't match the client (Next.js)
- Module not found: Can't resolve '...'
Weekly: the errors breaking vibe-coded apps and how to fix them. Free.
No spam. Unsubscribe anytime.