SandboxClient for synchronous scripts and AsyncSandboxClient for concurrent workloads. Both are importable from prime_sandboxes. Every feature page shows the sync client; the async client takes the same calls with await.
Sync client
Async client
Launch a fleet
bulk_wait_for_creation polls via the list endpoint, backing off automatically if the API throttles you. idempotency_key makes create retries safe. Tear down with bulk_delete.
For a full script, see prime/examples/sandbox_async_demo.py.
Error handling
All exceptions are importable directly fromprime_sandboxes.
Sandbox lifecycle errors
Raised when a sandbox is no longerRUNNING. SandboxOOMError, SandboxTimeoutError, and SandboxImagePullError are subclasses of SandboxNotRunningError, so catch the base class for broad handling.