Sign in

Open it up

Port previews

When an agent starts a web server inside a sandbox, create a signed link to it and open the app in your browser — without exposing the sandbox to the internet.

Start something to preview

Any HTTP server will do. It must listen on 0.0.0.0, not localhost — previews reach the sandbox through its network interface, not its loopback. For example, with exec:

Command
cd /workspace && nohup python3 -m http.server 3000 --bind 0.0.0.0 > server.log 2>&1 &

Create a preview link

POST /v1/sandboxes/{sandbox_id}/ports/{port}/preview

curl -sS -X POST "$SPAWN_API_URL/v1/sandboxes/$SANDBOX_ID/ports/3000/preview" \
  -H "Authorization: Bearer $SPAWN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "expires_in_seconds": 3600
  }'
Response 201 Created
{
  "url": "https://3000-3ecb0221-faf1-4976-a8ae-6fd6262de59a.dev-sandbox.renderops.com/?_renderops_token=<signed-token>",
  "expires_at": "2026-08-17T12:10:00Z"
}
port path, integer required
The port inside the sandbox, 1 to 65535.
expires_in_seconds integer
How long the link works: one second to 24 hours. Defaults to one hour.
  • On first use the signed token is checked, stored in a secure, HTTP-only cookie and removed from the address bar.
  • Requests are forwarded to the port on whichever machine the sandbox is on, over a private network.
  • A missing, invalid, expired or mismatched link returns 404 — the same as a sandbox that doesn’t exist, so links can’t be used to discover sandboxes.
Ctrl I