Skip to main content
For CLI setup and authentication, see CLI Quickstart.

Create a sandbox

With nothing specified you get the default reservation of 0.125 vCPU / 128 MiB. Use exact resources when you need a different allocation:
The response includes: The TypeScript SDK adds camelCase aliases (milliCpu, memMb, createdAt) alongside the raw API fields, so either spelling works.

Run a command

A string command runs through /bin/sh -c, so pipes and && work. Pass an array instead to execute a program directly without a shell:
A non-zero exit code is returned, not thrown. Check exitCode yourself; only transport and API failures raise RunCloudError. Exec requires the sandbox to be running; a paused sandbox returns 409.

List and inspect

You only ever see sandboxes owned by an organization you belong to.

Name a sandbox

A name is a label you choose. Set it at create, change it later, and filter on it with list. Nothing on the platform reads it, and names are not unique — two sandboxes may share one.
Renaming works in every state except destroyed (which returns 409), so a paused sandbox can be re-labelled without resuming it. Names are capped at 128 characters, and an empty name clears the label.
Renaming an exposed sandbox does not move its public hostname. The <name>-box.run.cloud prefix is fixed when you first expose the sandbox; to change it, destroy the sandbox and expose a new one.
This is how you attach an existing sandbox to something on your side — a project, a branch, a customer — without destroying it and paying to boot a replacement. Name it after the thing it belongs to, then find it again:
Filtering by name returns every live match — names are not unique, and a match may be stopped or archived rather than ready — so check state before you use the result.

Destroy

Billing stops when the sandbox is destroyed. Wrap your work in try/finally so a thrown error still tears the sandbox down:

Retry-safe creates

If your job runner might retry a create, pass an idempotency key. A repeat with the same key returns the original sandbox instead of spawning (and billing) a second one.

Errors