Wait until a sandbox is ready
Waits up to `wait_ms` for the sandbox's readiness probe (`readiness` on create) to pass, and answers with its state: `ready` (with `time_to_ready_ms`, from the create's start to the first passing try), `failed` (it did not pass within its `timeout_s`), or `pending` when `wait_ms` ran out first (call again). With `port` or `cmd` in the body the call sets that probe first, replacing the sandbox's earlier one, so a client can start a server with an exec and then wait for its port in one more call. SDKs wrap this as `waitUntilReady()`. A sandbox with no probe, and none in the body, is `400`. Probes run inside the sandbox (a connection to `127.0.0.1:<port>`, or the command) and bill like any other use of it. From inside another sandbox, setting a probe needs this sandbox to be within the caller's reach (`sandboxesCreateSandbox`; otherwise `403 forbidden`, `reason: egress_escalation` or `scope_escalation`); waiting on the probe already set does not. A probe set that way keeps probing if this sandbox later leaves the caller's reach.
/v1/sandboxes/{sandbox_id}/ready
Authentication
Path Parameters
sandbox_id
string
required
path
"sbx_01m5t68q1b590rj801nbzsqzkk"Request Body
application/jsonwait_ms
integer
port
integer
cmd
string | string[]
interval_ms
integer
timeout_s
integer
Responses
application/jsonobject
string
REQUIRED
readinesssandbox_id
string
REQUIRED
status
string
REQUIRED
pending, ready, failedprobe
object
REQUIRED
port
integer
cmd
string | string[]
interval_ms
integer
timeout_s
integer
attempts
integer
REQUIRED
ready_at
string (date-time) | null
REQUIRED
time_to_ready_ms
integer | null
REQUIRED
last_error
string | null
REQUIRED
waited_ms
number
REQUIRED
curl -X POST 'https://beta-api.b3os.org/v1/sandboxes/sbx_01m5t68q1b590rj801nbzsqzkk/ready' \ -H 'Authorization: Bearer YOUR_API_TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "wait_ms": 30000, "port": 1, "cmd": "string", "interval_ms": 5, "timeout_s": 1}'
const response = await fetch('https://beta-api.b3os.org/v1/sandboxes/sbx_01m5t68q1b590rj801nbzsqzkk/ready', { method: 'POST', headers: { "Authorization": "Bearer YOUR_API_TOKEN", "Content-Type": "application/json" }, body: JSON.stringify({ "wait_ms": 30000, "port": 1, "cmd": "string", "interval_ms": 5, "timeout_s": 1 })});const data = await response.json();console.log(data);
import requestsheaders = { 'Authorization': 'Bearer YOUR_API_TOKEN'}response = requests.post('https://beta-api.b3os.org/v1/sandboxes/sbx_01m5t68q1b590rj801nbzsqzkk/ready', headers=headers, json={ "wait_ms": 30000, "port": 1, "cmd": "string", "interval_ms": 5, "timeout_s": 1})print(response.json())
{ "object": "readiness", "sandbox_id": "sbx_01m5t68q1b590rj801nbzsqzkk", "status": "ready", "probe": { "port": 3000, "interval_ms": 10, "timeout_s": 60 }, "attempts": 41, "ready_at": "2026-10-25T19:00:00.431Z", "time_to_ready_ms": 427, "last_error": null, "waited_ms": 402.6}
Try this endpoint
/v1/sandboxes/{sandbox_id}/ready