Skip to content

Preview URLs

Expose a port your sandbox binds internally and get a public HTTPS URL — the fastest way to share a live preview of what your agent built (a web app, an API, a dashboard).

Get a URL for a port

python
# start something listening on the port first
sbx.commands.start("python3 -m http.server 3000")

url = sbx.get_host(3000)
print(url)   # https://3000-<sandbox-hex>.up.ai2in.dev
javascript
await sbx.commands.start("python3 -m http.server 3000");
const url = await sbx.getHost(3000);
console.log(url); // https://3000-<sandbox-hex>.up.ai2in.dev

The URL is https://<port>-<sandbox-id>.up.ai2in.dev. It's served over auto-provisioned TLS and routed to your sandbox's container. The sandbox id is unguessable, so the URL itself is the access capability — treat it like a secret.

Notes

  • The port must actually be bound inside the sandbox for the URL to respond; start your server before (or shortly after) requesting the host.
  • Works with any HTTP server — a static file server, Flask/FastAPI, a Vite dev server, etc.
  • The mapping is stateless: it keeps working across engine restarts as long as the sandbox is alive.
  • Deploying something permanent? Use persistent hosting instead — preview URLs live and die with the sandbox.

Sovereign compute for Indian AI — hosted in Mumbai (ap-south-1).