With the CLI
--detach is present.
Detached creation returns after durable provisioning begins, then you can run:
With TypeScript
createSession waits for readiness and attempts cleanup if readiness fails.
Use startSession when your process needs the sandbox ID before the wait.
Creation rules
- Every requested environment must be enabled for the workspace key.
- State is validated before the sandbox becomes ready.
- One invalid state payload fails the whole create request and triggers cleanup.
- Reusing an idempotency key with the same request returns the original result.
- Reusing it with a different request returns a conflict.
- Failed provisioning and cold-start time are not billed.
--idempotency-key only when your caller needs to retry the exact same create
request after an uncertain response.
Read expiresAt and the optional lease fields from the response. Server and
plan policy can reduce a requested TTL.