timeoutMinutes
is the sandbox’s total lifetime beginning when its VM starts, not a timeout
applied separately to each SDK operation.
For example, set a custom session timeout when creating the sandbox:
Getting a Sandbox
Fetch a detailed sandbox handle by ID:vcpus, memMiB, and
diskSizeMiB. The Node SDK exposes the same values as cpu, memoryMiB, and
diskMiB; the Python SDK exposes them as cpu, memory_mib, and disk_mib.
duration is the elapsed runtime in milliseconds after a sandbox ends, so it
is 0 while the sandbox is active. timeoutMinutes is the configured total
lifetime.
Listing Sandboxes
List your sandboxes with optional filtering:Refreshing and Connecting
Connect to an existing sandbox or refresh the runtime token.Create and get responses for an active sandbox include a runtime token that
is valid for 24 hours. The Node and Python SDKs automatically obtain a fresh
token shortly before expiry and retry a replayable runtime HTTP request once
with a fresh token after a
401. Call refresh() when you also want to
refresh the handle’s cached sandbox metadata.
For a more detailed guide to runtime tokens, see Sandbox Runtime URLs.Stopping a Sandbox
Always stop a sandbox when you are done with it:Exposing Ports
Expose a port when you need a custom process to be accessible from outside from the sandbox. This provides a custom runtime URL for that exposed port.auth is enabled, send the sandbox bearer token when calling the exposed URL:
For a dedicated guide to runtime URLs, exposed service URLs, browser auth
links, and end-to-end examples, see Sandbox Runtime URLs.