Skip to main content
POST
/
v1
/
machines
import requests url = "https://api.13-215-85-171.sslip.io/v1/machines" payload = {} headers = { "Idempotency-Key": "<idempotency-key>", "Authorization": "Bearer <token>", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.text)
{ "id": "mch_a1b2c3d4", "config": { "vcpus": 123, "memory_mb": 123, "disk_mb": 123 }, "template": "<string>", "created_at": "2023-11-07T05:31:56Z", "metadata": {}, "started_at": "2023-11-07T05:31:56Z", "timeout_ms": 123, "timeout_at": "2023-11-07T05:31:56Z", "expires_at": "2023-11-07T05:31:56Z", "cwd": "<string>", "traffic_access_token": "<string>", "warm_pool_checkout": { "hit": true, "id": "<string>" } }

Authorizations

Authorization
string
header
required

API key passed as Bearer token

Headers

Idempotency-Key
string
required

Reuse the same key to safely retry the same create, reusable snapshot create, fork, upload create/complete, or agent deployment create operation without duplicating work.

Body

application/json
snapshot_id
string

Durable reusable snapshot ID to restore into a fresh machine. When provided, sizing, template, environment, filesystem, and VM egress policy are taken from the snapshot; each create idempotency key creates at most one child machine and the snapshot remains reusable for additional create requests.

warm_pool
object

Optional custom template warm-pool selector for machine create. V1 requires an explicit id for prefer and require modes; bypass may omit id to force cold create.

template
string
default:base

Template name or Docker image

vcpus
integer
default:1
Required range: x >= 1
memory_mb
integer
default:256

Guest memory in MiB. When omitted, the default is template-aware: the heavyweight code-interpreter and desktop templates default to 2048MB (their GUI/kernel stacks exhaust a smaller allocation), and all other templates default to 256MB.

Required range: x >= 1
disk_mb
integer

Minimum rootfs size in MiB. On cold create the rootfs is grown to this size before boot. For snapshot-backed templates the disk size is fixed at build time, so disk_mb must not exceed the template's built-in size (rebuild the template with a larger disk_mb instead). Omit to use the default headroom. Not permitted with snapshot_id.

Required range: 512 <= x <= 131072
timeout_ms
integer
default:300000

Machine auto-destroy timeout in milliseconds

timeout_action
enum<string>
Available options:
destroy,
hibernate
inactivity_timeout_ms
integer<int64> | null

Opt-in idle timeout in milliseconds. When set, the machine runs timeout_action (hibernate or destroy) once it has been idle this long. Activity is edge ingress or exec/file/pty/process traffic; guest-internal idle egress does not count. Composes with the absolute timeout_ms (whichever fires first wins). Omit to keep the existing absolute-only behavior. Not a cap — purely opt-in ergonomics.

Required range: x >= 1
auto_delete_after_ms
integer<int64> | null

Opt-in window in milliseconds after which a hibernated/paused machine is destroyed. Acts only on terminal/hibernated machines; never deletes a running machine out from under active traffic.

Required range: x >= 1
ephemeral
boolean
default:false

When true the machine is never hibernated/snapshotted on inactivity; it is destroyed instead (forces timeout_action: destroy). Cannot be combined with auto_resume.

auto_resume
boolean
default:false

When true, a hibernated machine is automatically resumed when a command, file, PTY, desktop, or proxy route targets its original machine ID. Requires timeout_action: hibernate or lifecycle.on_timeout: pause.

envs
object
metadata
object

Arbitrary user-supplied metadata attached to the machine; stored verbatim (any JSON object), deliberately open.

internet_access
boolean
default:true

When false, the machine has no network connectivity.

cwd
string | null

Optional default working directory for machine commands. Must be an absolute machine path that stays within the machine root. Accepted values are normalized before persistence, and reserved runtime paths under /workspace/.nullspace are rejected. When omitted, commands inherit the template default workdir; the standard agent-oriented templates default to /workspace. Clients may send an explicit null, which is treated the same as omitting the field.

desktop
object
network
object
volumes
object[] | null

Create-time shared-volume mount requests. ref is the canonical selector and accepts either an exact volume name or a volume id. On snapshot resume and fork, shared mounts are remounted with fresh internal leases before the new machine becomes ready; that storage remount does not make VM memory or mutable rootfs state portable across incompatible runtime hosts.

Maximum array length: 8
lifecycle
object

Response

Machine created

id
string
required
Example:

"mch_a1b2c3d4"

status
enum<string>
required
Available options:
creating,
running,
paused,
destroyed,
error
config
object
required
template
string
required
created_at
string<date-time>
required
metadata
object

Machine metadata. Attached volume state is exposed under volume_attachments in request order. Free-form user-supplied object stored verbatim; deliberately open.

started_at
string<date-time>
timeout_ms
integer<int64>
timeout_at
string<date-time>
expires_at
string<date-time>

Alias of timeout_at for clients that expect an expiry timestamp field.

timeout_action
enum<string>
Available options:
destroy,
hibernate
cwd
string

Normalized default working directory for this machine when one was configured.

traffic_access_token
string

Opaque token returned at create time. Send it as x-nullspace-traffic-access-token when network.allow_public_traffic is false.

warm_pool_checkout
object

Create-time warm-pool checkout result. Omitted when create did not consider a warm pool.