ScalixScalix Docs
Sign up

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

bash
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

bash
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

  1. Created — sandbox is provisioning
  2. Running — ready to accept commands
  3. 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

ResourceDefaultMax
Memory512 MB32 GB
vCPUs116
Disk5 GB100 GB
Timeout300s (5 min)86400s (24 h)