SDKsPython

Retries & idempotency

How the BimpeAI Python SDK retries failed requests and how to control idempotency keys.

By default the SDK retries up to twice. It retries connection errors and timeouts, and the status codes 408, 429, and any 5xx other than 501; it never retries 409 or 501. Backoff is exponential with full jitter, and a 429 honours the Retry-After header. Change the budget per client or per call.

client = BimpeAI(api_key="sk_...", max_retries=3)
client.agents.create(name="A", max_retries=0)  # this call only

Idempotency

Write requests accept an idempotency_key. When retries are on and you do not supply one, the SDK generates a key once per call and reuses it across attempts, so a retried write cannot create a duplicate. The key is sent as the Idempotency-Key header.

client.agents.create(name="A", idempotency_key="create-A-2026-06-14")

Per-call overrides

The write methods (agents.create, agents.update, agents.knowledge_bases.create, agents.knowledge_bases.update, workflows.create, workflows.update, conversations.messages.send, and conversations.messages.stream_ticket) accept idempotency_key, timeout, max_retries, and headers as keyword arguments alongside the body. Each overrides the client-level setting for that one call. headers is merged into the request headers, which is the seam for sending a request id you control through X-Request-Id.

On this page