API error
rate_limited
HTTP 429 · no credit is used for a request that ends in an error.
The account or key sent more requests per second than its limit allows, the IP address sent more than 500 requests per second (requests with a key from Cloudflare Workers, which all share one address, are left out), or the IP address sent more than 20 requests with an invalid key in a minute (its further invalid keys get this for up to a minute; valid keys keep working). GET /v1/latency has its own limit instead, 20 requests in 10 seconds per IP address, and test and malformed addresses, which do not count toward the per-second limit, have a separate, much higher safety limit per key.
What to do
Wait for the number of seconds in Retry-After, then retry. Spread requests evenly over time, and fix an invalid key instead of retrying it.
Retry
Yes, after Retry-After. When and how often to retry any error: retrying safely.
The answer
{
"error": {
"code": "rate_limited",
"message": "Too many requests. Slow down and retry later.",
"request_id": "req_7Hq2LmX9cV4bN8tR1zK6wD"
}
}Branch on code, which is stable; message is for people and may change. Keep request_id in your logs.
Headers that come with it:
X-Request-Id: Our ID for the request (same asrequest_idin bodies).Retry-After: Seconds to wait before retrying.
Endpoints that can answer it
GET /v1/validate(429)POST /v1/validate(429)GET /v1/credits(429)GET /v1/usage(429)POST /v1/bulk(429)GET /v1/bulk/{id}(429)DELETE /v1/bulk/{id}(429)POST /v1/bulk/{id}/start(429)GET /v1/bulk/{id}/results(429)GET /v1/status(429)GET /v1/latency(429)GET /openapi.json(429)GET /openapi.yaml(429)GET /mcp(429)POST /mcp(429)GET /a2a(429)POST /a2a(429)GET /.well-known/agent-card.json(429)