# Create and wait for a sandbox

Collection: sdk
Human docs: https://zei.sh/docs/sdk

Use the retrying lifecycle helper for agent startup.

createAndStartSandbox creates a sandbox, waits for running, destroys a failed attempt, and retries. Its defaults are three attempts, a 90 second ready timeout, and a two second poll interval.
A normal create request already asks for a running runtime. Use the helper when startup reliability matters.

Example:

```
import { createAndStartSandbox } from "@zeish/computesdk-provider";

const sandbox = await createAndStartSandbox(api, {
  name: "agent-run",
  templateId: process.env.ZEISH_TEMPLATE_ID!,
  maxAttempts: 3,
  readyTimeoutMs: 90_000,
});
```
