Skip to main content
The SDK handles connections, encoding, pagination cursors, and retry backoff. You control timeouts, idempotency keys, and what to do when a call fails. Use a configured SDK client. The examples share that client and the IDs returned by earlier steps.

Timeouts and retries

Replace your client initialization with these defaults. Python uses seconds; TypeScript and JavaScript use milliseconds; Go and Rust use durations.
Python
By default the SDK retries twice on network errors, 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.
Once you have the ID, use it. Don’t start a new run because you stopped waiting for the old one.

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
If you copy records into another system, checkpoint after each page succeeds and make the destination tolerant of seeing a record twice.

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.