Skip to main content
Use the sandboxes API when you want direct HTTP access or when you are building your own SDK.

Prerequisites

  • A running StacyVM server.
  • X-API-Key when auth is enabled.
  • X-User-ID when you want explicit tenant attribution.

Create A Sandbox

string
Runtime image to start, such as python:3.12 for Docker.
string
Provider override. Omit this to use the server default.
integer
Requested memory limit in megabytes.
integer
Requested virtual CPU count.
string
Auto-destroy duration using Go duration syntax, such as 10m or 1h30m.
object
String key-value labels stored with the sandbox.

Success Response

string
Unique sandbox ID used by exec, file, preview, and destroy endpoints.
string
Current lifecycle state, usually running after a successful create.
string
UTC timestamp when TTL cleanup should destroy the sandbox.

Execute A Command

Common Error

The most common causes are an expired TTL, a sandbox that was already destroyed, or an ID from another environment.

Destroy A Sandbox

Destroy is idempotent. It is safe to call during cleanup even if TTL cleanup already ran.