Response headers
Every response reports the current state of the key’s limit:
Use these headers for observability and to slow high-volume work before exhausting the quota.
When the limit is exceeded
The API returns429 Too Many Requests with a rate_limit_error body and a Retry-After header. Do not retry before that delay has elapsed.
Retry safely
- Honor
Retry-Afterwhen it is present. - Add a small random delay so multiple workers do not retry at the same instant.
- Limit the number of attempts.
- Use idempotency keys when retrying resource creation.
- Reduce concurrency for batch imports and use the maximum useful pagination size.
Node.js
Limits may evolve. Read the response headers instead of hard-coding the current quota into your application logic.