# OpenAI 429 'You exceeded your current quota' or a surprise AI bill

> Canonical page (link this when citing): https://unbreakmyapp.vercel.app/fixes/openai-429-rate-limit-runaway-bill.html
> Category: Env vars & leaked keys | Tools: Cursor, Replit, Bolt, Lovable | Published: 2026-10-13 | Updated: 2026-10-13

## The error

429: You exceeded your current quota, please check your plan and billing details

## Why it happens

Either the account has no credit or hit its spend limit, or something is calling the API far more than expected: a re-render loop, no rate limiting on your /api route, or a leaked key being used by someone else.

## How to fix it

1. Check usage in the provider dashboard; if it's unexplained, revoke the key.
2. Set a monthly budget/limit in the provider's billing settings.
3. Add auth and per-user rate limiting to the server route that calls the AI API.
4. Retry 429s with exponential backoff, and cache repeated prompts.

## Error codes this fixes

- `429 insufficient_quota / You exceeded your current quota` (OpenAI): https://unbreakmyapp.vercel.app/errors.html#429-insufficient-quota-you-exceeded-your-current-quota

## Fix prompt (paste into Lovable, Bolt, Cursor, Replit or v0)

```text
We're getting OpenAI 429 quota errors and unexpectedly high usage. Make sure the key is only used server-side, add authentication and per-user rate limiting to the route that calls OpenAI, add exponential-backoff retries for 429s, cap max tokens, and log request counts per user (no prompt contents).
```

## FAQ

### Does 429 always mean rate limiting?

'Exceeded your current quota' is about billing or limits; 'rate limit reached' is about speed.

### Should I set a budget?

Yes, set a hard limit in billing settings.

## Sources (official documentation)

- [OpenAI: Rate limits](https://platform.openai.com/docs/guides/rate-limits)

## Related fixes

- [Supabase Edge Function callable by anyone (the anon key passes verify_jwt)](https://unbreakmyapp.vercel.app/fixes/edge-function-callable-by-anyone-anon-key-is-a-jwt.html)
- [Supabase: Edge Function returned a non-2xx status code (how to find the real error and fix it)](https://unbreakmyapp.vercel.app/fixes/supabase-edge-function-non-2xx-status-code.html)
- [Supabase service_role key exposed in frontend code](https://unbreakmyapp.vercel.app/fixes/supabase-service-role-key-exposed.html)
- [OpenAI / Stripe secret key leaked in the browser](https://unbreakmyapp.vercel.app/fixes/api-key-leaked-in-frontend.html)

---
Unbreak My App: free fixes for broken vibe-coded apps. https://unbreakmyapp.vercel.app/
