GET /v1/sandboxes/{sandbox_id}/logs
Server-sent events with the output of background processes: `log.stdout` and `log.stderr` per chunk and `process.exited` when one ends. Starts with up to 1 MiB of buffered output per process, then follows new output until the sandbox stops (or immediately ends with `follow=false`). Filter to one process with `pid`. Authenticate with the `Authorization` header or a ticket from `POST /v1/sandboxes/{sandbox_id}/ticket` (`?ticket=`, for `EventSource`).

Authentication

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

Path Parameters

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

Query Parameters

pid integer optional query
Only this process.
follow boolean optional query
Keep the stream open for new output.
ticket string optional query
A single-use stream ticket from the resource's `POST …/ticket` operation, for clients that cannot set headers (browser `WebSocket` and `EventSource`); see the `ticket` security scheme. WebSocket clients may send it as a subprotocol instead: `Sec-WebSocket-Protocol: b3os.v1, b3os.ticket.<ticket>`. Query strings are redacted from logs.

Header Parameters

Last-Event-ID string optional header
Resume an event stream after this event `id` (the `seq` of the last event you processed).

Responses

200 The log stream.
text/event-stream
string
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`).
429 A rate, concurrency or quota limit applies (`rate_limited`, `concurrency_limited`, `quota_exceeded`).
500 Something failed inside B3OS (`internal`). Retry with backoff.
502 The agent inside the microVM did not answer (`guest_unreachable`).
503 The node or the product is not available right now (`node_unavailable`, `product_unavailable`, `capacity_unavailable`).
curl -X GET 'https://beta-api.b3os.org/v1/sandboxes/sbx_01m5t68q1b590rj801nbzsqzkk/logs' \  -H 'Authorization: Bearer YOUR_API_TOKEN'
const response = await fetch('https://beta-api.b3os.org/v1/sandboxes/sbx_01m5t68q1b590rj801nbzsqzkk/logs', {  method: 'GET',  headers: {      "Authorization": "Bearer YOUR_API_TOKEN"  }});const data = await response.json();console.log(data);
import requestsheaders = {    'Authorization': 'Bearer YOUR_API_TOKEN'}response = requests.get('https://beta-api.b3os.org/v1/sandboxes/sbx_01m5t68q1b590rj801nbzsqzkk/logs', headers=headers)print(response.json())
200 Response
"id: 7\nevent: log.stdout\ndata: {\"type\":\"log.stdout\",\"ts\":\"2026-10-25T19:01:02.400Z\",\"job_id\":\"sbx_01m5t68q1b590rj801nbzsqzkk\",\"seq\":7,\"pid\":812,\"data\":\"ready on http://localhost:3000\\n\"}\n\n"
Ask a question... ⌘I