Skip to main content
Sandboxes have real URL endpoints when you start it. No extra configuration required. Pick your favorite framework and get started. Sandboxes have two types of URLs:
  • runtime - This is the URL you use to access the sandbox’s runtime API. It is reserved on port 4001.
  • custom - This is any other port you wish to expose within the sandbox that is not reserved. You can set up any process you want on the sandbox on the specified port.

Runtime URL vs Custom Port URL

Every running sandbox includes a runtime base URL for API calls.
The SDK handles the sandbox runtime layer for you when you use the runtime functions. See Node SDK sandboxes and Python SDK sandboxes.
To make a service reachable, start it inside the sandbox and expose its port. For example:
  • runtime.host looks like https://<regional-runtime-host>
  • runtime.baseUrl looks like https://<regional-runtime-host>/sandbox/<sandbox-id>
  • exposed port 3000 uses a separate, sandbox-specific URL
The SDK can derive that URL locally:

Example: Expose a Public HTTP Server

The example below provides a public URL which you can use for running your own services inside the sandbox. For sensitive workloads, treat this as any other publicly accessible endpoint and authenticate your requests properly.
Start a simple HTTP server inside the sandbox, expose port 3000, and call it from outside the sandbox.

Auth Enabled (auth: true)

When auth is true, the exposed custom URL now requires the auth token to be passed on each request.
Call exposure.url programmatically and pass the sandbox bearer token in the Authorization header.
Open exposure.browserUrl in a browser when you need a user-facing flow for an auth-protected endpoint.
browserUrl performs auth bootstrap first and then redirects to the path in next.
Use auth: false when you want open browser access and keep auth/authorization logic inside your own application.

Backend Workflow (Bearer Token)

This flow is best for backend automation and API calls. Call the protected exposed URL with the sandbox bearer token.

Browser Workflow (Preview URL Redirect)

Use the auth-enabled endpoint to generate a protected preview URL for browser access.
browserUrl is not the raw port API URL. It is a bootstrap URL that sets the auth cookie and then redirects to next. Use url for programmatic clients, and use browserUrl when you want to land a browser on a protected page.