429 Too Many Requests; temporary upstream capacity limits can also produce 429.
What is limited
- RPM: requests per minute; burst limits control short spikes.
- Concurrency: synchronous, streaming or realtime requests still running.
- Input and output TPM: tokens processed per minute.
- Active asynchronous tasks: image or video tasks that have not reached a terminal state.
Response headers
Retry-After gives the suggested wait in seconds. Headers may include x-ratelimit-limit-requests, x-ratelimit-remaining-requests and x-ratelimit-reset-requests. Concurrency and token limits use corresponding concurrent-requests, input-tokens or output-tokens suffixes.
Respond safely
- Honor
Retry-After; do not retry in a tight loop. - If absent, use bounded exponential backoff with jitter, such as increasing waits of 1, 2, 4 and 8 seconds.
- Close completed streams and limit the worker count for batch jobs.
- Do not assume that creating more keys increases a shared customer allowance.