Overview
Certain errors will be automatically retried 2 times by default, with a short exponential backoff.Default Retry Behavior
By default, the SDK retries all:- Connection errors
- 408 Request Timeout
- 409 Conflict
- 429 Rate Limit
- ≥500 Internal errors
The default number of retries is 2, with a short exponential backoff between attempts.
Configuring Retries
You can use theWithMaxRetries option to configure or disable automatic retries.
Configure Default Retries for All Requests
Override Retries Per Request
Setting
WithMaxRetries(0) will disable automatic retries completely.Best Practices
- Use higher retry counts for operations that are naturally idempotent
- Consider disabling retries for time-sensitive operations
- Combine with timeout configuration to control overall request duration
