Skip to content
Docs menu

Retries, timeouts and idempotency

What the SDKs retry for you, and how to retry safely over HTTP.

What the SDKs retry

  • Retried: connection errors, 408, 409 when the server says it is retryable, 429 (the Retry-After header is honoured) and 5xx. Waits start at 0.5 s and double up to 8 s, with jitter, up to the retry count (default 2). A Retry-After longer than 120 s is not waited for: the error is raised.
  • Never retried: an out-of-PLUMES error and every other 4xx.
  • Timeouts: connect 5 s, reads 30 s, generation and streams 10 minutes. Override per client or per call.

Idempotency keys

Every generating request carries an Idempotency-Key that is reused across the SDK's own retries, so a retry never creates a second job or a second charge. You can set your own key (8 to 128 letters, digits, dot, dash, underscore or colon; a UUID works). If a request times out or the connection drops, send it again with the same key and the same body: you get the original answer and are not charged twice. Reusing a key with a different body is a 409 Conflict.

catalyst.wave.generate("door knock", idempotency_key="order-1042")

Per-call overrides

catalyst.wave.generate("rain", timeout=120)                 # seconds
Catalyst(max_retries=0)                                      # no retries at all