Recipe: retry and backoff
Recipe — retry and backoff. Pointer to the SDK's built-in retry behaviour.
Last updated
Was this helpful?
Recipe — retry and backoff. Pointer to the SDK's built-in retry behaviour.
The SDK retries automatically on these conditions, no client code needed:
RateLimitError (429) — respects Retry-After response header
InternalServerError (500), 502, 503, 504 — exponential backoff
APIConnectionError — transient network blip
Defaults: max_retries=2, exponential backoff, configurable via Stratix(max_retries=N, timeout=...). To disable: Stratix(max_retries=0).
For per-request override: client.with_options(timeout=300.0).evaluations.create(...).
If you need request-level retries beyond the SDK's defaults (e.g., long-running batch with custom backoff), wrap the call in tenacity or similar — but most paying-customer use-cases don't require this.
Last updated
Was this helpful?
Was this helpful?