Ephemeral Sandboxes
Short-lived environments for one-shot code execution and testing
Overview
Ephemeral sandboxes are short-lived environments that automatically terminate after a timeout. Use them for running scripts, executing tests, or processing data.
Create
curl -X POST https://api.scalix.world/v1/sandboxes \
-H "Authorization: Bearer $SCALIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"runtime": "node22",
"timeout_ms": 300000
}'Available runtime today: node22. More runtimes (python3.12, python3.13, node24, go1.22, rust-latest) are rolling out. Requests for a runtime that is not yet available may fail or fall back to a base image.
Execute Code
curl -X POST https://api.scalix.world/v1/sandboxes/{id}/commands \
-H "Authorization: Bearer $SCALIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{"cmd": "node", "args": ["-e", "console.log(2+2)"]}'Lifecycle
- Created — sandbox is provisioning
- Running — ready to accept commands
- Stopped — idle timeout reached, hard timeout reached, or manually deleted
Ephemeral sandboxes are disposable. They stop automatically after a period of
inactivity (idle timeout) and at the hard timeout_ms deadline, whichever
comes first. Each command execution counts as activity and resets the idle
clock; POST /v1/sandboxes/{id}/extend pushes out the hard deadline.
No state persists past stop. There are no snapshots for ephemeral sandboxes. Treat everything on the rootfs as scratch space, and write anything you need to keep to your own storage before the sandbox stops. Compute is billed per vCPU-hour and GB-hour of allocation while the sandbox is running; a stopped sandbox costs nothing.
Resource Limits
| Resource | Default | Max |
|---|---|---|
| Memory | 512 MB | 32 GB |
| vCPUs | 1 | 16 |
| Disk | 5 GB | 100 GB |
| Timeout | 300s (5 min) | 86400s (24 h) |