Skip to main content
POST
Create a sandbox

Authorizations

Authorization
string
header
required

An API key (fb_live_…)

Headers

Idempotency-Key
string

A key of yours (1 to 255 characters). A repeat with the same key within 24 hours returns the first sandbox.

Body

application/json
image
string

The image it starts from.

Maximum string length: 512
size
enum<string>

xsmall, small, medium, large or xlarge; small if left out.

Available options:
xsmall,
small,
medium,
large,
xlarge
cpu_cores
number

vCPUs.

Required range: 0.25 <= x <= 16
memory_mb
integer

Memory, in MB.

Required range: 256 <= x <= 32768
env_vars
object

Environment variables for every command in the sandbox.

entrypoint
string[]

The command it runs as its main program, instead of the image's.

exposed_port
integer

The port its url serves. 8000 unless set.

Required range: 1 <= x <= 65535
lifetime_sec
integer

Seconds until it is deleted automatically, counted from now: 60 up to 10 years. Left out, the sandbox is kept until you delete it; on PATCH, null removes it.

Required range: 60 <= x <= 315360000
idle_timeout_sec
integer

Seconds with nothing happening before it sleeps; 0 never sleeps. 300 unless set.

Required range: 0 <= x <= 86400
snapshot
string

The name of a snapshot to start from, already running where it was.

Required string length: 1 - 100
ready
enum<string>

When it counts as running: process (as soon as it runs) or port (once exposed_port answers).

Available options:
port,
process
network
object

What it can reach: {"allow": [...]} for only those names and addresses, {"block": true} for nothing. Leave it out for the whole internet.

runtime
enum<string>

standard, or vm (a full virtual machine with its own kernel).

Available options:
standard,
vm
needs
enum<string>[]

What it must be able to do: docker, fuse, cgroups, loop, iptables (these pick vm), browser, desktop.

Maximum array length: 7
Available options:
docker,
fuse,
cgroups,
loop,
iptables,
browser,
desktop
init
enum<string>

systemd when the image's systemd runs as the first process (vm only).

Available options:
systemd
labels
object

Your own key-value tags, up to 16. Keys: lowercase letters, digits, ., _, -.

secrets
string[]

Stored secrets by name, given as environment variables. Up to 50; naming them needs a key with secrets.read, and a key bound to one sandbox cannot. In an answer: the names only.

Maximum array length: 50
Maximum string length: 255
Pattern: ^[A-Z_][A-Z0-9_]*$

Response

Success

id
string
required

Its ID.

Pattern: ^sbx-[0-9a-f]{10}$
status
string
required

Its current state.

image
string | null
required

The image it starts from.

cpu_cores
number
required

vCPUs.

memory_mb
integer
required

Memory, in MB.

disk_gb
integer
required

Writable disk: xsmall and small 10, medium 20, large 40, xlarge 80

runtime
enum<string>
required

standard, or vm (a full virtual machine with its own kernel).

Available options:
standard,
vm
init
enum<string> | null
required

systemd as PID 1 (vm only)

Available options:
systemd
created_at
string<date-time>
required

When it was created.

expires_at
string<date-time> | null
required

When its lifetime ends and it is deleted; null when it has none (kept until deleted)

idle_timeout_sec
integer
required

Seconds with nothing happening before it sleeps; 0 never sleeps. 300 unless set.

ready
enum<string>
required

When it counts as running: process (as soon as it runs) or port (once exposed_port answers).

Available options:
port,
process
network
object | null
required

What it can reach: {"allow": [...]} for only those names and addresses, {"block": true} for nothing. Leave it out for the whole internet.

labels
object
required

Your own key-value tags, up to 16. Keys: lowercase letters, digits, ., _, -.

secrets
string[]
required

The stored secrets it gets as environment variables, by name (never their values)

hostname
string
required

Its HTTPS hostname.

url
string<uri>
required

Its public HTTPS address, serving exposed_port.

runtime_reason
string
required

requested | snapshot | database | init: | needs: | default

host_port
integer

Internal.

snapshot
string

The name of a snapshot to start from, already running where it was.

browser
object

With needs: ["browser"]

desktop_url
string

With needs: ["desktop"]: a single-use link to the desktop

desktop_expires_in
integer

Seconds until the unopened desktop link expires.