API 429 Errors: Rate Limits, Retry-After, and Safe Retries

An API 429 error means the server rejected a request because of a rate or usage limit. Read the response body and headers first, identify the limit, and allow only a bounded retry. For operations with side effects, determine whether the first request completed before sending another one.

What 429 means

RFC 6585 defines 429 as "too many requests in some period." The response may contain Retry-After, but the standard does not specify a single way of counting: the server can limit a single resource, a key, a project, an organization, or an entire cluster.

Therefore, status 429 in itself does not answer the question “how long to wait.” For one API, this is a short-term RPM or TPM limit; for another, it is an exhausted balance, a monthly quota, or a set spending limit. For example, in the current OpenAI error table different reasons 429 have different codes: temporary exceeding the rate limit, exhausted credit and project or organization limits. They cannot be repeated by one handler.