Error: 429 You exceeded your current quota, please check your plan and billing details.
Node.js · updated 2026-11-11
Thrown by the openai Node SDK as RateLimitError (its stack prints Error) when the API answers 429. The SDK already retried twice by default (maxRetries 2) before throwing. The message and error.code come from OpenAI's response: a rate limit ("Rate limit reached for requests" or tokens) or a billing problem (the long-standing "You exceeded your current quota" message, credit_balance_exhausted in the current error reference).
Error: 429 You exceeded your current quota, please check your plan and billing details.
at APIError.generate (node_modules/openai/core/error.mjs:59:20)
at OpenAI.makeStatusError (node_modules/openai/client.mjs:446:32)
at OpenAI.makeRequest (node_modules/openai/client.mjs:1014:30)
status: 429, code: 'insufficient_quota'Quick fix
Look at error.code and the message before touching retries. Quota or credit errors mean the account is out of money or past its spend limit: add credits or raise the limit, and stop retrying. Rate limit errors mean you are sending too fast: respect the Retry-After header, back off with jitter, and lower concurrency.
- Log error.status, error.code and the message for every 429.
- Quota, billing or credit codes: add credits or raise the project spend limit in the OpenAI dashboard. Retrying will not help.
- Rate limit codes: wait as long as Retry-After says, then retry with exponential backoff and jitter, and cap retries.
- Remember the SDK already retried twice; set maxRetries deliberately rather than stacking your own loop on top.
- Reduce bursts: queue requests, lower parallelism, batch where you can.
import OpenAI, { RateLimitError } from 'openai';
const openai = new OpenAI({ maxRetries: 3 }); // the SDK backs off between retries
try {
return await openai.chat.completions.create({ model, messages });
} catch (err) {
if (err instanceof RateLimitError && /quota|credit|billing/i.test(`${err.code} ${err.message}`)) {
// Out of credits or over the spend limit: tell someone, don't retry
throw new Error('OpenAI account is out of credits', { cause: err });
}
throw err;
}Paste this into Claude Code, Cursor or Codex in the project that throws it. The agent reads this guide in plain text and applies the fix that matches your stack.
Read https://runheed.com/errors/openai-429-rate-limit-or-quota.md and fix this error in this project.Why it happens
No credits or spend limit reached
The organization or project has no prepaid credits left or hit its monthly limit. Every request fails until billing changes.
Too many requests at once
A burst of parallel calls (a backfill, a fan-out, a retry storm) passes the per-minute request or token limit.
Retries that make it worse
Your own retry loop on top of the SDK's two retries multiplies traffic during a rate limit.
A key from another project
The key belongs to a project with lower limits or no credits.
Other fixes
- Alert on quota errors the first time they happen: they stop every AI feature at once and nothing recovers without a billing change.
- Keep rate-limit retries out of user-facing request paths when you can; queue the work instead.
Same error, other wording
- RateLimitError: 429 Rate limit reached for requests
- openai.RateLimitError: Error code: 429 - You exceeded your current quota, please check your plan and billing details.
- Error code: 429 - credit_balance_exhausted
Let your coding agent catch the next one
Runheed records this error in production with the stack trace, the breadcrumbs before it and, when you set it, the agent session that shipped the code, and serves it to Claude Code, Cursor or any MCP client. With it connected, you can ask:
> Find the OpenAI 429 errors, split them into quota/billing versus rate limits using the error code, fix the retry and concurrency settings for the rate limits, and tell me if the account is out of credits.
Setup for Node.js and Express or Vercel Functions, then have your agent fix and resolve it.
Related errors
- AxiosError: Request failed with status code 401
- TypeError: fetch failed
- [UnhandledPromiseRejection: This error originated either by throwing inside of an async...
More in Network and HTTP
- Error: read ECONNRESETNode.js
- Error: connect ECONNREFUSED 127.0.0.1:5432Node.js
- Error: connect ETIMEDOUT 10.0.4.12:5432Node.js
- Error: self-signed certificate in certificate chainNode.js
- Error: getaddrinfo ENOTFOUND api.example.comNode.js
- Error: write EPIPENode.js
- Access to fetch at 'https://api.example.com/orders' from origin 'https://app.example.com'...Node.js
- FunctionsHttpError: Edge Function returned a non-2xx status codeSupabase
- requests.exceptions.ConnectionError: HTTPSConnectionPool(host='api.example.com'...Python
- httpx.ReadTimeout: The read operation timed outPython
- ConnectionResetError: [Errno 104] Connection reset by peerPython
- BrokenPipeError: [Errno 32] Broken pipePython
- [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer...Python
- Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the clientNode.js
- 422 Unprocessable Entity: {"detail":[{"type":"missing","loc":["body","email"],"msg":"Field...Python
- No signatures found matching the expected signature for payload. Are you passing the raw...Node.js
- TokenExpiredError: jwt expiredNode.js
References: OpenAI docs: error codes (429 rate limit vs credit balance, retry guidance), openai-node README: retries (default 2) and errors
Spotted a mistake? Email hello@greatwork.company. About Runheed.