Rate limits and retries
What to do when the thing you call says "slow down".
I'm calling <the API> from <where>. It has a rate limit of <limit, or "I don't know">. Add proper handling: - Retry on failures that are worth retrying, and only those. Tell me which status codes you decided are retryable and why. - Exponential backoff with jitter. Explain the jitter part. - A hard ceiling on attempts, so a broken call can't loop forever. - Respect a Retry-After header if one comes back. Show me what the user sees while this is happening.
Retrying a 400 forever is how you turn one bad request into a rate-limit ban. Retry what might work next time; fail fast on what never will.