Extend a sandbox's timeout
Sets the sandbox to expire `timeout_s` seconds from now (up to your plan's maximum lifetime). Works on running and paused sandboxes. A longer life is billed (`sandboxes.vcpu_ms`, `sandboxes.gib_ms`), so the call is admitted like a create (credits, spend cap).
POST
/v1/sandboxes/{sandbox_id}/timeout
Sets the sandbox to expire `timeout_s` seconds from now (up to your plan's maximum lifetime). Works on running
and paused sandboxes. A longer life is billed (`sandboxes.vcpu_ms`, `sandboxes.gib_ms`), so the call is
admitted like a create (credits, spend cap).
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 required
application/jsontimeout_s
integer
REQUIRED
Responses
200
The sandbox with its new `expires_at`.
application/jsonid
string
REQUIRED
object
string
REQUIRED
Enum:
sandboxstatus
string
REQUIRED
`running` → `paused` ↔ `running` → `stopped`. `failed` means the microVM crashed; its usage is final.
Enum:
running, paused, stopped, failedhost_id
string
REQUIRED
The ID in host-safe form, used in port URLs.
template
object
REQUIRED
id
string
REQUIRED
name
string
REQUIRED
snapshot
string | null
REQUIRED
The snapshot the sandbox was restored from.
vcpu
integer
REQUIRED
memory_mib
integer
REQUIRED
disk_gib
integer
REQUIRED
timeout_s
integer
REQUIRED
on_idle
string
REQUIRED
Enum:
stop, pauseexpires_at
string (date-time)
REQUIRED
env
object
REQUIRED
secret_names
string[]
REQUIRED
Names of the variables set from `secrets` (values are never returned).
Array of:
string
ports
object[]
REQUIRED
Array of:
port
integer
REQUIRED
public
boolean
REQUIRED
url
string (uri) | null
REQUIRED
Public ports: the long-lived preview URL, token included. Private ports: `null`; mint a URL with
`POST /v1/sandboxes/{sandbox_id}/ports/{port}/url`.
api
object
REQUIRED
scopes
string[]
REQUIRED
Array of:
string
spend_cap_usd
number | null
REQUIRED
The grant's own cap, or `null` when the creating principal's cap applies.
connections
string[]
REQUIRED
Array of:
string
egress
object
REQUIRED
mode
string
REQUIRED
Enum:
public, allowlist, denyallow
string[]
REQUIRED
Array of:
string
forkable
boolean
REQUIRED
created_at
string (date-time)
REQUIRED
started_at
string (date-time)
REQUIRED
paused_at
string (date-time) | null
REQUIRED
stopped_at
string (date-time) | null
REQUIRED
stop_reason
string | null
REQUIRED
Why the sandbox stopped.
Enum:
deleted, timeout, failed, nullusage
object
REQUIRED
vcpu_ms
integer
REQUIRED
gib_ms
integer
REQUIRED
timing
object
Server-side phase durations in milliseconds with microsecond resolution: the same phases as the
`Server-Timing` header, keyed `<phase>_ms`. `total_ms` is always present. Phase names are product-specific
and documented per operation. Example values in this reference are illustrative, not measurements.
total_ms
number
REQUIRED
metadata
object
REQUIRED
Up to 16 string key-value pairs you attach to an object for your own use. Keys are 1 to 40 characters of
`A-Z a-z 0-9 _ . : -`; values are at most 500 characters. B3OS never interprets them.
400
The request failed validation (`invalid_request`, `invalid_url`).
401
Missing, malformed, expired or revoked credentials (`unauthorized`).
402
The organization has no credits left, or the key reached its spend cap.
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.
422
The request exceeds a plan limit (`limit_exceeded`).
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/timeout' \ -H 'Authorization: Bearer YOUR_API_TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "timeout_s": 1800}'
const response = await fetch('https://beta-api.b3os.org/v1/sandboxes/sbx_01m5t68q1b590rj801nbzsqzkk/timeout', { method: 'POST', headers: { "Authorization": "Bearer YOUR_API_TOKEN", "Content-Type": "application/json" }, body: JSON.stringify({ "timeout_s": 1800 })});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/timeout', headers=headers, json={ "timeout_s": 1800})print(response.json())
200
Response
{ "id": "sbx_01m5t68q1b590rj801nbzsqzkk", "object": "sandbox", "status": "running", "host_id": "sbx-01m5t68q1b590rj801nbzsqzkk", "template": { "id": "tpl_01m5t59b2ps0djyzdf082s18bz", "name": "base" }, "snapshot": null, "vcpu": 2, "memory_mib": 2048, "disk_gib": 4, "timeout_s": 1800, "on_idle": "stop", "expires_at": "2026-10-25T19:35:00.000Z", "env": {}, "secret_names": [], "ports": [], "api": { "scopes": [], "spend_cap_usd": null, "connections": [] }, "egress": { "mode": "public", "allow": [] }, "forkable": false, "created_at": "2026-10-25T19:00:00.000Z", "started_at": "2026-10-25T19:00:00.004Z", "paused_at": null, "stopped_at": null, "stop_reason": null, "usage": { "vcpu_ms": 2100, "gib_ms": 600000 }, "metadata": {}}
API Playground
Try this endpoint
POST
/v1/sandboxes/{sandbox_id}/timeout