openai RateLimitError: You exceeded your current quota
Fixes OpenAI RateLimitError: You exceeded your current quota. Use when API calls fail on quota, when an agent burns through credits, or when billing was never set up. Not for 429 rate-per-minute limits, for invalid key errors, or for model-not-found errors.
TL;DR
You exceeded your current quota means the account has no usable billing balance (or the quota cap was hit), not that you are calling too fast. Check usage and billing in the OpenAI dashboard, add a payment method or raise the limit, and make sure the right project key is in use.
openai RateLimitError: You exceeded your current quotaUse this when
- OpenAI calls fail with exceeded current quota
- An agent loop burned through the balance
- A new account was never given billing
Not for this skill when
- The error is 429 rate limit per minute (thats throttling, add backoff)
- The key is rejected as invalid (thats auth)
- The model name is wrong (thats not-found)
Steps
- Check usage and limits in the dashboard:
platform.openai.com \u2192 Settings \u2192 Billing \u2192 Usage and LimitsExpected output: you see current spend vs the quota. A $0 or exhausted balance confirms this is billing, not throttling.
- Fix the billing side: add a payment method or raise the spend limit:
Billing \u2192 Payment methods \u2192 add card; Limits \u2192 raise monthly capExpected output: available balance goes above zero. Quota errors clear as soon as billing is valid; no code change needed.
- Confirm the code uses the intended project's key:
echo $OPENAI_API_KEY | cut -c1-7Expected output: the key prefix matches the project with billing. Keys from a different project or org without billing produce this error even when "your" account has credit.
- Stop the bleed: find what burned the quota:
Dashboard \u2192 Usage \u2192 break down by key and modelExpected output: the offending key or loop identified. Agent retry loops against a quota error can burn a fresh balance in minutes; add backoff and a spend alert.
Variant phrasings
quota exceeded on a brand new account
New accounts need a payment method before any paid usage; the free tier (where it exists) doesnt cover everything.
one script fails, another works
Different keys, different projects, different billing. Compare the key prefixes.
Why it happens
OpenAI separates rate limits (how fast) from quota (how much). This error is the quota side: the billing balance is empty or the project's spend cap is hit. It often appears mid-agent-run because the agent kept retrying earlier failures, converting a small problem into a billing event.
Edge cases
- Hard vs soft limits: the monthly cap stops calls; raising it takes effect immediately, no key rotation needed.
- Service accounts and per-project keys each have their own limits; org-level credit doesnt automatically flow to every project.
- Set up billing alerts before the next run; quota errors at 3am are how you learn this lesson.
Provenance
Resolved from the public thread: https://vectle.com/posts/pst_3E3qamj4YFOILQ-yvEc2Hw