Sandboxes
post/v1/sandboxes

Request

  • Base URL: /api (relative, and the document was published on a file host, not at the API’s origin)
  • URL: /api/v1/sandboxes
  • Auth: HTTP bearer

Request body

_runtimestring nullable
backendstring nullable

Isolation backend: "docker" (default), "firecracker" (ADR-029, hardware-virtualized microVM — requires a host provisioned with temps firecracker setup) or "microsandbox" (ADR-050, experimental libkrun microVM — requires temps microsandbox setup). Omit for the platform default; existing clients are unaffected. Requesting an unavailable backend fails with 400 rather than silently downgrading isolation.

cpu_limitnumber double nullable
disk_size_mbinteger nullable

Root disk size in MB (Firecracker only; Docker ignores it). Omit for the platform default (1 GiB).

envobject

Extra env vars baked into the container on create.

from_snapshotstring nullable

Create the sandbox from a snapshot (ADR-037).

Mutually exclusive with image: if both are set the request fails with 400. When set, the sandbox is created with the snapshotted filesystem rather than a base image, giving users a reproducible starting point.

The snapshot must be in ready status and belong to the calling user.

imagestring nullable

Docker image override. null uses the platform default.

lifecyclestring nullable

Lifecycle class (ADR-036, temps-native): "ephemeral" (default) or "workspace".

A workspace is a long-lived development environment: it is still suspended after timeout_secs of inactivity, but the next exec or filesystem call wakes it transparently instead of returning 409, and nothing ever destroys it automatically. Use it for "give me a place to work on this repo"; leave it unset for throwaway sandboxes.

memory_limit_mbinteger nullable
namestring nullable
networkPolicyunknown
nodestring nullable

Node to create the sandbox on (ADR-048): a node name, a node id, or control-plane / 0 for the control plane. Omit to let Temps place it (the control plane when allowed, otherwise the allowed worker with the fewest live sandboxes). The node must be allowed by the operator's sandbox placement settings and online; otherwise the request fails with 422 — it never silently falls back to another node.

pids_limitinteger nullable
portsinteger[]

Ports the sandbox will listen on. Each port becomes a routes[] entry in the create/get response so @vercel/sandbox's sandbox.domain(port) can resolve it client-side without an extra round-trip.

preview_passwordstring nullable

Optional preview-URL password. When set, every preview URL served for this sandbox is gated behind a login form. 8–256 characters. Omit to leave preview URLs open (the sandbox ID remains the only gate). The plaintext is never returned; only the last-4 hint is surfaced in SandboxResponse.preview_password_hint.

projectIdstring nullable
project_idinteger nullable

Create the sandbox against a temps project (temps-native). The project's connected repo and git credential seed the work dir when no explicit source is given, and the sandbox is attributed to the project so it can be listed alongside it.

Requires access to the project and git_repositories:read when Temps derives the source from the project. The same team/scope rules that gate every other project-scoped endpoint apply.

timeoutinteger nullable

Idle timeout as sent by @vercel/sandbox (milliseconds). Converted to seconds when timeout_secs is absent.

timeout_secsinteger nullable

Idle timeout in seconds (temps-native). Clamped to [60, 86400].

Example request

{
  "node": "worker-1"
}

Response

Sandbox created

Changes

    • info

      added the new optional request property

    • info

      added the non-success response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the required property / to the response with the status

    • breaking

      removed the required property / from the response with the status

    • warning

      removed the request property

    • warning

      removed the optional property / from the response with the status

    • info

      removed the non-success response with the status