Managed · Bare-metal KVM · REST API

Sandbank
Cloud

Managed sandbox infrastructure for AI agents.
Bare-metal KVM. Sub-second start. Pay-per-use.

< 1sCold start with warm pool
$0.02per sandbox
Scroll ↓

AI Agents

Autonomous Setup

Add this one line to your agent's system prompt. It will learn to create, execute, and manage sandboxes on its own.

Add to your agent prompt

Read https://api.sandbank.dev/skill.md and follow instructions

The skill file contains complete API documentation, authentication setup, and usage examples. Your agent reads it once and operates autonomously.

Pricing

$0.02
per sandbox. That's it.

Create sandboxincludes 10 min
$0.02
Extend +10 min$0.02
Exec / files / proxyFree

Pay with USDC on Base network via the x402 payment protocol. No signup, no API key, no subscription. Your agent handles the payment automatically.

x402 protocol · USDC on Base (eip155:8453)

Resource Limits

CPU2 vCPU
Memory1024 MB RAM
Session10 min session
Disk5 GB disk

Resources exceeding the limit are clamped automatically.

Default Image

codebox
Claude CodeCodex

Pre-built development sandbox with Claude Code, Codex, and full-stack tooling. Ready to run AI coding agents out of the box.

7681Web terminal on port 7681 (ttyd)
8080Web service on port 8080

Ubuntu 24.04 · Node.js 22 · Python 3 · Go 1.23 · Bun · uv · git · gh · db9 · psql · ripgrep · fd · tmux · vim · make · build-essential

Warm pool enabled — sub-second cold start.

Browser

Browser automation.
Built into every sandbox.

Lightpandadefault

Lightweight headless browser running inside the sandbox. Instant startup, zero overhead.

+Instant — no VM spin-up
+Read pages, scrape, simple forms
–Limited JS engine
Browserbox--chrome

Real Chrome in a dedicated KVM micro-VM. Full rendering, login flows, complex SPAs.

+Full Chrome rendering & JS
+VM snapshots — save & restore sessions
+Login flows, OAuth, CAPTCHAs
+PNG screenshots via relay
browser-automation.sh
# Default: Lightpanda (fast, in-sandbox)
browser open https://docs.example.com
browser snapshot -i              # accessibility tree with refs
browser click @e2                # interact by ref
browser screenshot               # save PNG to /tmp/screenshot.png

# Chrome mode: real browser for complex sites
browser open --chrome https://app.example.com/login
browser fill @e1 "[email protected]"
browser fill @e2 "password"
browser click @e3                # submit login
browser screenshot               # visual confirmation
browser save logged-in           # snapshot VM state
browser destroy                  # back to Lightpanda

The agent decides which mode to use. Add --chrome when a site needs real Chrome. Once a browserbox exists, all commands route to it automatically.

Database

Serverless Postgres.
Built into every sandbox.

db9 CLI and psql are pre-installed. Create, query, branch, and manage PostgreSQL databases from the terminal — zero config. Built-in pgvector, pg_cron, filesystem queries, and full-text search.

PostgreSQL 17pgvectorpg_cronfs9HTTP extFull-text search
db9-in-sandbox.sh
# db9 CLI is pre-installed in every codebox

# Create a database (zero-setup trial on first use)
db9 db create --name myapp

# Execute SQL
db9 db sql myapp -q "CREATE TABLE users (id serial, name text, email text)"
db9 db sql myapp -q "INSERT INTO users (name, email) VALUES ('Alice', '[email protected]')"

# Vector search with pgvector
db9 db sql myapp -q "CREATE EXTENSION vector"
db9 db sql myapp -q "ALTER TABLE users ADD COLUMN embedding vector(1536)"

# Branch a database for isolated testing
db9 branch create myapp --name experiment

# Or connect directly with psql
psql $DATABASE_URL -c "SELECT * FROM users"

db9 skill is auto-injected — agents learn db9 commands autonomously. Databases persist beyond sandbox lifetime. Powered by db9.ai.

Features

KVMBare-metal isolation
Warm PoolSub-second starts
BrowserBuilt-in automation
DB9Serverless Postgres
WebSocketTerminal & proxy
x402Pay-per-use USDC

Quick Start

create.sh
# Create a sandbox — x402 payment is handled automatically
# The server returns 402 with payment details, your x402 client pays and retries
curl -X POST https://api.sandbank.dev/v1/boxes \
  -H "Content-Type: application/json" \
  -d '{"image": "codebox", "cpu": 2, "memory_mb": 1024}'

# → {"id": "aQscOYX87tSq", "status": "running", ...}
exec.sh
# Execute a command (free after sandbox is created)
curl -X POST https://api.sandbank.dev/v1/boxes/aQscOYX87tSq/exec \
  -H "Content-Type: application/json" \
  -d '{"cmd": ["echo", "Hello from the sandbox"]}'

# → {"exit_code": 0, "stdout": "Hello from the sandbox\n", ...}
destroy.sh
# Destroy when done (free)
curl -X DELETE https://api.sandbank.dev/v1/boxes/aQscOYX87tSq

TypeScript SDK

sandbox.ts
import { createProvider } from '@sandbank.dev/core'
import { SandbankCloudAdapter } from '@sandbank.dev/cloud'

const provider = createProvider(
  new SandbankCloudAdapter({
    // x402: pay $0.02/sandbox with USDC on Base
    walletPrivateKey: process.env.WALLET_PRIVATE_KEY,

    // Or use API token (bypasses x402 payment)
    // apiToken: process.env.SANDBANK_API_TOKEN,
  })
)

const sandbox = await provider.create({
  image: 'codebox',
  resources: { cpu: 2, memory: 1024 },
  ports: [[0, 7681], [0, 8080]],
})

const { stdout } = await sandbox.exec('node -e "console.log(42)"')
console.log(stdout) // 42

await provider.destroy(sandbox.id)

Webhooks

Lifecycle webhooks.
Admin and tenant delivery.

Tenants can configure tenant delivery in the Sandbank Panel. Operators can also configure admin delivery for incident response.

Admin webhook

Operator-facing events include node_id, source, and internal detail fields for incident response.

Tenant webhook

Tenant events are matched by box user_id and omit admin-only fields such as node_id, source, and detail.

admin-webhook.env
ADMIN_BOX_LIFECYCLE_WEBHOOK_URL=https://ops.example.com/webhooks/sandbank
ADMIN_BOX_LIFECYCLE_WEBHOOK_TOKEN=change-me
ADMIN_BOX_LIFECYCLE_WEBHOOK_TIMEOUT_MS=2000
tenant-webhooks.env
# Tenant ids must match box user_id values.
# For API keys, user_id is the AGENT_API_KEYS label: wanman:key
TENANT_BOX_LIFECYCLE_WEBHOOKS='{
  "wanman": {
    "url": "https://wanman.example.com/webhooks/sandbank",
    "secret": "wanman-hmac-secret",
    "token": "optional-bearer-token",
    "events": ["box.error", "box.terminated"],
    "timeout_ms": 1500
  }
}'
TENANT_BOX_LIFECYCLE_WEBHOOK_TIMEOUT_MS=2000

Tenant events

box.errorbox.terminatedbox.status_changed
tenant-payload.json
{
  "event": "box.error",
  "audience": "tenant",
  "tenant_id": "wanman",
  "box_id": "box-1",
  "image": "codebox",
  "previous_status": "running",
  "status": "error",
  "reason": "probe_failure",
  "observed_at": "2026-05-01T05:41:00.000Z"
}

Tenant requests include X-Sandbank-Tenant, X-Sandbank-Event, and X-Sandbank-Delivery. Configure secret for X-Sandbank-Signature: sha256=<hmac-sha256>; configure token for Authorization: Bearer <token>.

API Reference

REST API.
Simple JSON. No SDK required.

POST/v1/boxes$0.02

Create a sandbox

GET/v1/boxes

List sandboxes

GET/v1/boxes/:id

Get sandbox details

POST/v1/boxes/:id/exec

Execute a command

POST/v1/boxes/:id/keep$0.02

Extend timeout

PUT/v1/boxes/:id/files?path=/

Upload files (tar)

GET/v1/boxes/:id/files?path=/

Download files (tar)

DELETE/v1/boxes/:id

Destroy sandbox

ALL/v1/boxes/:id/proxy/:port/*

HTTP/WS proxy to guest

POST/v1/boxes/:id/clone

Clone box (COW)

POST/v1/boxes/:id/snapshots

Create snapshot

GET/v1/boxes/:id/snapshots

List snapshots

POST/v1/boxes/:id/snapshots/:name/restore

Restore snapshot

DELETE/v1/boxes/:id/snapshots/:name

Delete snapshot

Base URL: https://api.sandbank.dev

Port Forwarding

ports.sh
# Create sandbox with port forwarding
curl -X POST https://api.sandbank.dev/v1/boxes \
  -H "Content-Type: application/json" \
  -d '{"image": "codebox", "ports": [[0, 8080], [0, 7681]]}'

# → {"id": "abc", "ports": {"8080": 10042, "7681": 10043}, ...}

# Access guest port 8080 via HTTP proxy
curl https://api.sandbank.dev/v1/boxes/abc/proxy/8080/