Timeouts and retries
Replace your client initialization with these defaults. Python uses seconds; TypeScript and JavaScript use milliseconds; Go and Rust use durations.Python
429, and 5xx, with
backoff, honoring Retry-After. It only retries writes that carry an
idempotency key. It never retries 400, 401, 403, 404, or 409. Set
max_retries=0 to turn retries off.
Launching a world can take longer than a normal request; the SDK uses a longer
timeout for that call automatically. wait helpers have their own deadline,
separate from the per-request timeout.
Idempotency keys
worlds.create and evaluations.create take an idempotency_key. Pick
something that identifies the intent, like a build number, and store it with
the request.
- Same key, same inputs: you get the original world or run back. Safe to retry after a timeout or crash.
- Same key, different inputs:
409. - New key: a new world or run.
Errors
API failures expose the status, the server’s message, and a request ID to quote in support conversations. Transport errors may have no HTTP status or request ID. Replace<world-id> below with the ID returned by your world launch.
Python
Don’t log full world or event payloads; they contain live twin tokens and your
own business data.
Pagination
List methods return a page. These examples visit every task. Replace<task-suite-id> with world.evaluation.task_suite_id from a ready world or
suite.id from creating a suite.
Python
Success isn’t always done
Some calls return before the work finishes. Check the object, not just the absence of an error:
The
wait helpers make the first part easy; the second part is yours.