A developer is implementing retry logic for calls to the Anthropic Messages API in a production service. The service must handle transient failures gracefully without overwhelming the API. Which TWO practices should the developer implement? (Choose two.)
Status 429 indicates rate limiting and 500 indicates a server-side error, both of which are typically transient. Retrying with exponential backoff and jitter spaces out attempts and avoids synchronized retry storms. Jitter prevents many clients from retrying simultaneously. This combination is a standard resilient pattern that improves success rates without hammering the API during periods of contention.
Why this answer
Resilient retry logic targets transient failures such as 429 and 500 responses, spacing attempts with exponential backoff plus jitter to avoid synchronized retry storms. A retry cap, whether by count or total time budget, prevents runaway loops and bounds latency. Client errors like 400 and 401 are not transient and should not be retried, and the API does not redeliver failed requests, so some client-side retry strategy is necessary.
Exam trap
The trap here is treating all HTTP errors as retryable, when client errors such as 400 and 401 will never succeed on a repeated identical request.