API guide
Handle rate limits without losing work
Use the response headers
RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset describe your current request allowance. A 429 response includes Retry-After in seconds. Limits apply to both the key and workspace; creating more keys does not bypass the workspace limit.
Back off and retain idempotency
Wait at least Retry-After, add jitter and retry within a bounded retry budget. Keep the same Idempotency-Key for a write. Limit parallel work in your application rather than allowing an unbounded retry queue.
A plan or monthly send quota error is different from a short rate limit. Read the error code and resolve the allowance before retrying.