Run agent code in a microVM of its own.

Create a sandbox from a template, run a command and open a port, all through one API.

  • Firecracker microVMs
  • Access per organization
api.openrelay.inc
$ curl https://api.openrelay.inc/v1/sandboxes \
    -H "Authorization: Bearer $OPENRELAY_API_KEY" \
    --json '{"template": "python",
             "run": {"cmd": "python -c \"print(6 * 7)\""}}'
{
  "id": "sbx_07_01JC8Q9V3W",
  "state": "running",
  "result": { "exitCode": 0, "stdout": "42\n" }
}

$ curl https://api.openrelay.inc/v1/sandboxes/sbx_07_01JC8Q9V3W/ports \
    -H "Authorization: Bearer $OPENRELAY_API_KEY" \
    --json '{"port": 8000}'
{
  "port": 8000,
  "url": "https://sbx-07-01jc8q9v3w-8000.sandbox.openrelay.inc"
}

Restored, not booted.

A template boots once and its memory and disk are saved. Every sandbox starts from that snapshot, a guest that has already booted.

RESTORINGRUNNINGRESTORINGRUNNINGRESTORINGRUNNINGSNAPSHOTHOST

A kernel of its own.

Each sandbox is a Firecracker microVM with its own guest kernel, network namespace and copy of the template's disk.

CONTAINERSONE SHARED KERNELSANDBOXESA KERNEL EACH

Output as it runs.

Stream a command line by line. After a dropped connection, the same execId picks up after the last line you read.

API reference
POST /v1/sandboxes/{id}/exec
$ curl https://api.openrelay.inc/v1/sandboxes/$SANDBOX_ID/exec \
    -H "Authorization: Bearer $OPENRELAY_API_KEY" \
    -H "Accept: application/x-ndjson" \
    --json '{"execId": "steps",
             "cmd": "for i in 1 2 3; do echo step $i; sleep 1; done"}'
{"type": "stdout", "text": "step 1\n", "seq": 1}
{"type": "stdout", "text": "step 2\n", "seq": 2}
(connection lost)

$ curl https://api.openrelay.inc/v1/sandboxes/$SANDBOX_ID/exec \
    -H "Authorization: Bearer $OPENRELAY_API_KEY" \
    -H "Accept: application/x-ndjson" \
    --json '{"execId": "steps", "offset": 2,
             "cmd": "for i in 1 2 3; do echo step $i; sleep 1; done"}'
{"type": "stdout", "text": "step 3\n", "seq": 3}
{"type": "exit", "exitCode": 0, "seq": 4}

Your tools, preinstalled.

A template runs your init commands once, before its snapshot. Every sandbox from it starts with them, on the template's machine.

POST /v1/sandbox-templates
$ curl https://api.openrelay.inc/v1/sandbox-templates \
    -H "Authorization: Bearer $OPENRELAY_API_KEY" \
    --json '{"name": "dev-tools", "image": "rootfs.ext4",
             "cpu": 4, "memoryMiB": 8192,
             "init": ["apt-get update", "apt-get install -y git jq ripgrep"]}'
{ "id": "tpl_0b6f2a52-6c1e-4a59-9b51-0f3c2f3f9a10", "state": "building" }

$ curl https://api.openrelay.inc/v1/sandbox-templates/$TEMPLATE_ID \
    -H "Authorization: Bearer $OPENRELAY_API_KEY"
{ "name": "dev-tools", "state": "ready", "cpu": 4, "memoryMiB": 8192 }
vCPUs
1 to 64
Memory
128 MiB to 16 GiB
Longest lifetime
24 hours
Templates per organization
50

Priced per second.

Not billed yet: these rates apply when billing begins.

CPU
$0.0594 / vCPU-hour
Memory
$0.0198 / GiB-hour
See sandbox pricing

Questions.

How is a sandbox different from a container?

A container shares the host's kernel. A sandbox is a Firecracker microVM with a guest kernel of its own, so the code inside never runs on the host's kernel.

Can I bring my own image?

Build a template: it starts from the base image rootfs.ext4 (Ubuntu 24.04 with Python 3) and runs your init commands before its snapshot is taken. Container image references are not accepted today.

What does a sandbox cost?

CPU at $0.0594 per vCPU-hour and memory at $0.0198 per GiB-hour, metered each second. Sandbox compute is not billed yet; these rates apply when billing begins.

How do I get access?

Sandboxes are enabled per organization: request access, then follow the Sandboxes guide in the docs. File access, ports, terminals, pause and resume, and group creation are enabled separately.

Run your first sandbox.

Access is enabled per organization. Ask for it, then create a sandbox with one API call.