> For the complete documentation index, see [llms.txt](https://docs.layerlens.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.layerlens.ai/more-in-this-section-9/retry-backoff.md).

# Recipe: retry and backoff

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(...)`.

## When to add your own retry

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.

## See also

* [SDK reference: client configuration](/more-in-this-section-9/client.md)
* [SDK reference: errors](/more-in-this-section-9/errors-1.md)
* [Cookbook: rate-limit handling](/more-in-this-section-9/rate-limit-handling.md)
