Delete a sandbox
Stops the sandbox and destroys its memory and disk. Snapshots taken from it are kept. Returns the stopped sandbox with its final usage.
DELETE
/v1/sandboxes/{sandbox_id}
Stops the sandbox and destroys its memory and disk. Snapshots taken from it are kept. Returns the stopped sandbox with its final usage.
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"Responses
200
The stopped sandbox.
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`).
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.
503
The node or the product is not available right now (`node_unavailable`, `product_unavailable`, `capacity_unavailable`).
curl -X DELETE 'https://beta-api.b3os.org/v1/sandboxes/sbx_01m5t68q1b590rj801nbzsqzkk' \ -H 'Authorization: Bearer YOUR_API_TOKEN'
const response = await fetch('https://beta-api.b3os.org/v1/sandboxes/sbx_01m5t68q1b590rj801nbzsqzkk', { method: 'DELETE', headers: { "Authorization": "Bearer YOUR_API_TOKEN" }});const data = await response.json();console.log(data);
import requestsheaders = { 'Authorization': 'Bearer YOUR_API_TOKEN'}response = requests.delete('https://beta-api.b3os.org/v1/sandboxes/sbx_01m5t68q1b590rj801nbzsqzkk', headers=headers)print(response.json())
200
Response
{ "id": "sbx_01m5t68q1b590rj801nbzsqzkk", "object": "sandbox", "status": "stopped", "host_id": "sbx-01m5t68q1b590rj801nbzsqzkk", "template": { "id": "tpl_01m5t59b2ps0djyzdf082s18bz", "name": "base" }, "snapshot": null, "vcpu": 2, "memory_mib": 2048, "disk_gib": 4, "timeout_s": 900, "on_idle": "stop", "expires_at": "2026-10-25T19:15:00.004Z", "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": "2026-10-25T19:05:12.300Z", "stop_reason": "deleted", "usage": { "vcpu_ms": 31877, "gib_ms": 639204000 }, "metadata": {}}
API Playground
Try this endpoint
DELETE
/v1/sandboxes/{sandbox_id}