POST /v1/sandboxes/{sandbox_id}/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.

Authentication

Bearer Token (b3os_sk_ API key or b3os_pat_ token) API Key (cookie: __Host-b3os_session)

Path Parameters

sandbox_id string required path
The sandbox ID (`sbx_…`).
Example: "sbx_01m5t68q1b590rj801nbzsqzkk"

Request Body

application/json
wait_ms integer
port integer
cmd string | string[]
One of:
Option 1string
Option 2
Array of: string
interval_ms integer
timeout_s integer

Responses

200 The readiness state when the probe settled or `wait_ms` ran out.
application/json
object string REQUIRED
Enum: readiness
sandbox_id string REQUIRED
status string REQUIRED
`pending`: `wait_ms` passed first; ask again.
Enum: pending, ready, failed
probe object REQUIRED
When the sandbox counts as ready: a TCP port inside it accepting connections (`port`), or a command that exits 0 (`cmd`, run as `user` with a 5 s limit per try). Set exactly one. The node tries it every `interval_ms` from the moment it is set until it passes or `timeout_s` runs out; the sandbox's `readiness` reports the result and `POST /v1/sandboxes/{sandbox_id}/ready` waits for it. Probing goes on across a restart of the node's daemon, within the same `timeout_s`; `attempts` counts the tries since the daemon last recorded a change of `status`, so it can start again from a lower number after such a restart.
port integer
cmd string | string[]
A shell command line (run with `/bin/sh -c`) or an argv array.
One of:
Option 1string
Option 2
Array of: 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
How long this call waited.
400 The request failed validation (`invalid_request`, `invalid_url`).
401 Missing, malformed, expired or revoked credentials (`unauthorized`).
403 Authenticated but not allowed (`forbidden`, `egress_denied`).
404 No such sandbox in this project (`sandbox_not_found`).
409 The sandbox is paused or stopped (`sandbox_not_running`).
413 The request body exceeds this operation's limit.
415 The Content-Type is not accepted by this operation.
429 A rate, concurrency or quota limit applies (`rate_limited`, `concurrency_limited`, `quota_exceeded`).
500 Something failed inside B3OS (`internal`). Retry with backoff.
503 The node or the product is not available right now (`node_unavailable`, `product_unavailable`, `capacity_unavailable`).
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())
200 Response
{  "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}
Ask a question... ⌘I