Sandbox as a Service

A sandbox for your agent, in one API call

Sign in, copy your key, paste three commands. A minute later your agent has a dedicated virtual machine it can break — and you have not installed an SDK, configured a cluster or spoken to anyone.

  • No SDK to installplain HTTP, or an MCP server
  • $5 freeno card required
  • $0.09/hour46% under E2B's rate
  • Own kerneldedicated VM, never shared
  • Preview URLsshare what the agent built
  • 24-hour sessionsno plan, no upgrade
API=https://sandbox-as-a-service.com/v1
AUTH="Authorization: Bearer $AAS_API_KEY"
JSON="Content-Type: application/json"

# 1. Create a sandbox
SBX=$(curl -sS -X POST -H "$AUTH" -H "$JSON" \
  -d '{"size":"small"}' \
  $API/sandboxes | jq -r .id)

# 2. Run a command in it
curl -sS -X POST -H "$AUTH" -H "$JSON" \
  -d '{"command":"python3 -c \"print(6*7)\""}' \
  $API/sandboxes/$SBX/exec

# 3. Destroy it
curl -sS -X DELETE -H "$AUTH" $API/sandboxes/$SBX
import os, requests

API = "https://sandbox-as-a-service.com/v1"
headers = {"Authorization": f"Bearer {os.environ['AAS_API_KEY']}"}

# Create a sandbox
sandbox = requests.post(f"{API}/sandboxes", headers=headers,
                        json={"size": "small", "timeout_minutes": 15}).json()

# Run untrusted, model-generated code inside it
result = requests.post(f"{API}/sandboxes/{sandbox['id']}/exec", headers=headers,
                       json={"command": "python3 -c 'print(6*7)'"}).json()
print(result["stdout"])        # -> 42
print(result["exit_code"])     # -> 0

# Clean up (or let it expire on its own)
requests.delete(f"{API}/sandboxes/{sandbox['id']}", headers=headers)
const API = "https://sandbox-as-a-service.com/v1";
const headers = {
  Authorization: `Bearer ${process.env.AAS_API_KEY}`,
  "Content-Type": "application/json",
};

// Create a sandbox
const sandbox = await fetch(`${API}/sandboxes`, {
  method: "POST",
  headers,
  body: JSON.stringify({ size: "small", timeout_minutes: 15 }),
}).then((r) => r.json());

// Run untrusted, model-generated code inside it
const result = await fetch(`${API}/sandboxes/${sandbox.id}/exec`, {
  method: "POST",
  headers,
  body: JSON.stringify({ command: "node -e 'console.log(6*7)'" }),
}).then((r) => r.json());

console.log(result.stdout);    // -> 42

// Clean up (or let it expire on its own)
await fetch(`${API}/sandboxes/${sandbox.id}`, { method: "DELETE", headers });

What it costs, next to E2B

Same vCPU, same memory. Their published rate card, our arithmetic — check it.

SizeHereSame shape on E2B
small · 2 vCPU, 4 GB $0.09/hr $0.17/hr 46% less
medium · 4 vCPU, 8 GB $0.28/hr $0.33/hr 15% less
large · 8 vCPU, 16 GB $0.55/hr $0.66/hr 17% less

E2B's column is their published $0.000014/vCPU/second and $0.0000045/GiB/second applied to the same shapes, read from e2b.dev/pricing on 22 August 2026, and before their $150/month Pro plan. It is our sum, not a figure they quote. The full comparison also says where they are ahead of us — SDKs, faster starts, and a much larger free credit.

Three calls: create, execute, destroy

The API surface is deliberately small. There is no cluster to configure, no image to build, and no agent to install inside the sandbox.

Create a sandbox

POST /v1/sandboxes returns once the machine is booted and ready to accept commands. Pass an Idempotency-Key and retries are safe.

Run commands

POST /v1/sandboxes/{id}/exec runs a shell command as an unprivileged user and returns stdout, stderr, exit code and duration. Python 3, Node.js 22, git and a build toolchain are pre-installed.

Destroy it

DELETE /v1/sandboxes/{id} tears the machine down and stops billing. If you forget, the sandbox expires on its own timeout — orphaned machines are reconciled automatically.

Built for code you did not write

VM-level isolation

Each sandbox is its own virtual machine, not a container on a shared kernel. Customer code runs as an unprivileged user with no sudo and no access to the control plane.

About half a minute, and we publish the measurement

A sandbox is a real VM with its own kernel, not a container forked from a running host, so every create is a real boot from a prepared image: about half a minute. That number is measured and published rather than described, along with the conditions behind it.

Nothing left behind

Sandboxes expire on a timeout you set. A reconciler continuously compares what we think is running against what actually is, and destroys anything unaccounted for.

Per-second billing

Prepaid credit, charged for the time it runs, to the second. No subscription, no seats, no minimum. An idle account costs nothing.

Real toolchain

Python 3.12 with numpy and pandas, Node.js 22, git, curl and build-essential are already installed. Add more with pip install --user --break-system-packages, a virtualenv, or npm install — your code runs unprivileged, so there is no root and no apt.

MCP built in

An MCP server exposes the same operations as agent tools, so an agent can provision its own workspace without you writing glue code.

What people build with it

Running LLM-generated code

Your model writes a script; you execute it somewhere it can do no damage, capture the output, and feed it back into the loop. See LLM code execution.

Autonomous coding agents

Give an agent a machine where it can clone a repository, install dependencies, run the test suite and iterate — without touching your laptop or your CI runners. See AI agent sandboxes.

Data analysis on request

Spin up a sandbox per analysis job, run pandas or a notebook script against the data, return the result, destroy the machine. Nothing persists between jobs by design.

Untrusted user code

If your product lets customers submit code — evaluations, plugins, grading — each submission can get its own machine. New accounts run 20 sandboxes at once; ask us if you need more. See secure code execution.

Pricing

Prepaid credit, billed for the time a sandbox runs, to the second. Buy credit when you need it; it does not expire.

SizevCPUMemoryDiskPrice
small24 GB40 GB $0.09/hour
medium48 GB80 GB $0.28/hour
large816 GB160 GB $0.55/hour

A sandbox that runs for 12 minutes on the small size costs about $0.018. Full details on the pricing page.

Questions

What exactly is a sandbox here?

A sandbox is a dedicated virtual machine with its own kernel, filesystem, memory and network stack. It is not a container sharing a host kernel with other customers, and it is never reused between accounts. When the sandbox is destroyed the machine is destroyed with it.

How is this different from running code in a container?

Containers share the host kernel, so a kernel-level escape affects every workload on that host. Each sandbox here is a separate virtual machine, so the isolation boundary is the hypervisor rather than the kernel namespace. That matters when the code you are running was written by a language model and you cannot review it first.

How long does a sandbox take to start?

About half a minute. Every sandbox is a real virtual machine booted on demand from a prepared image; that image is why it is tens of seconds rather than the several minutes an unprepared machine takes. The measured numbers, and the method behind them, are published in the limits documentation rather than given as a marketing figure.

What does it cost?

You buy prepaid credit and are charged for the time a sandbox actually runs, billed by the second with no minimum and no rounding up — from $0.09/hour for the small size. There is no monthly subscription and no per-seat fee. New accounts start with $5 of credit. Full breakdown on the pricing page.

Can my AI agent drive this directly?

Yes. Besides the REST API there is an MCP server, so any MCP-compatible agent (Claude Code, Claude Desktop, and other MCP clients) can create sandboxes, run commands and tear them down as tool calls.

What happens to my data?

Everything inside a sandbox lives only for the life of that sandbox. When it is destroyed, the underlying machine and its disk are destroyed. We store metadata about the sandbox (id, size, timestamps) and the commands you submit through the API, so we can show you your history and bill correctly. See the privacy policy.

Start in the free tier

No credit card required. New accounts get $5 of runtime credit — about 56 hours of sandbox time.