SPAWNBOX

◐ Runs today on a plain sandbox · template coming

Host the app your agent built.Behind a link you control.

Run a Next.js or Vite app in a sandbox, keep it running as a service, and share it with a link. This works today. A ready-made web app template and a guide are coming.

Any app that serves HTTP, for example

  • Next.js
  • Vite
  • React
  • Astro
  • SvelteKit
  • Django
  • FastAPI
VISITORSANDBOXnpm run startSPAWNBOX APIKEYS · SITE RULESYOUR SERVERTEMPLATECOMING
FIG. 04 · ONE REQUEST, THERE AND BACK
0102

Follow one request.

Each step shows the call, the reply and the lines it adds to the activity log. You can read the whole log withGET /v1/sandboxes/$S/events.

Every step except the last one uses features that work today. The last step, marked PLANNED, is the tested, ready-made template and guide that are coming.

  1. SPAWNBOX API

    Build the app into a template

    Setup runs one time, as root, with network access. The response is 202 with a build. Wait until the build is ready, or the next step gives 409.

    REQUEST
    POST /v1/templates
    
    {"name": "shop", "base": "node:22-bookworm-slim",
     "setup": [
       "git clone --depth 1 https://github.com/acme/shop /workspace/app",
       "cd /workspace/app && npm ci && npm run build",
       "chown -R 1000:1000 /workspace/app"]}
  2. SPAWNBOX API

    Start it and keep it running

    A persistent sandbox stays until you delete it. The service starts the app, checks it over HTTP and starts it again if it stops.

    REQUEST
    POST /v1/sandboxes
    
    {"template": "shop", "persistent": true,
     "services": [{
       "name": "web",
       "command": ["npm", "run", "start"],
       "cwd": "/workspace/app",
       "port": 3000, "access": "public",
       "health": {"http": "/"}
     }]}
    • sandbox.createdsbx_2hn7k4pz9qe1wx6d
    • service.startedweb
  3. YOUR APP

    Share the link

    Access can be public, need a token, or need a session token for one person. A request waits up to 30 s for the app to be healthy.

    REQUEST
    GET /v1/sandboxes/$S/ports
    URL
    https://{label}.preview.example.com
  4. IN THE SANDBOX

    It crashes and comes back

    Spawnbox starts the app again after 1 s, then 2 s and 4 s, up to 30 s. It also restarts the app after 3 failed health checks in a row.

    • service.exitedweb · code 1
    • service.restartedweb · exit
  5. IN THE SANDBOX

    It sleeps when no one visits

    After 10 minutes with no requests, the sandbox pauses and frees its CPU and memory. The next visit wakes it in about 65 ms. If its VM is lost, the next request starts it again from the template, with the same link.

    • sandbox.pausedidle
    • sandbox.resumed
  6. SPAWNBOX APIPLANNED

    Coming: a ready-made web app template

    Templates for Next.js and Vite apps, and a step-by-step guide to host one.

0202

Good to know.