all or sandbox. GET routes need read; everything else needs read_write. Sandboxes are on Plus, Pro, and Enterprise: an API key on a free plan gets 402, a dashboard session gets 403.
Pass ?teamId= to work with a team’s sandboxes. A team-scoped key only sees its team’s sandboxes.
All paths are relative to https://server.pxxl.app/api/v3.
Endpoints
The sandbox object
creating, running, paused (you stopped it), paused_idle (auto-stop), paused_low_balance (wallet ran low), or failed. Treat the older stopped and paused_insufficient_points as paused.The outbound network policy:
mode is allow-all, deny-all, or allowlist, and allow lists the allowed domains and CIDRs. See network policies.Get pricing
GET /sandboxes/pricing
Public. No API key needed.
List sandboxes
GET /sandboxes
usage.hourlyBurnUsd is what everything running right now costs per hour.
Filter by label
Addlabel=key:value to keep only sandboxes with that label. Repeat it to require several; label=key matches any value of key.
Create a sandbox
POST /sandboxes
base (Debian 13), node, python, go, rust, or bun. nodejs, js, and typescript mean node; py means python; golang means go. GET /sandboxes/pricing lists each template’s runtime version.Up to 20 labels, as
{ "key": "value" }. Keys match ^[a-z0-9][a-z0-9_.-]{0,62}$. Values are one line, up to 256 characters.The outbound network policy,
{ "mode": "...", "allow": [...] }. Left out, the sandbox reaches the whole internet. With allow entries and no mode, it is an allowlist. See network policies.Start from a snapshot: its home directory and
/workspace come back. The template comes from the snapshot, so template isn’t needed.202
creating. Poll GET /sandboxes/{id} until status is running (usually a few seconds), or failed.
Get or update a sandbox
GET /sandboxes/{id} returns { sandbox }.
PATCH /sandboxes/{id} changes the name, auto-stop, preview access, labels, or network policy. labels replaces all of them; {} clears them.
Network policies
egress controls the sandbox’s outbound connections.
allow entries are domains (github.com matches exactly, *.npmjs.org matches any subdomain) or public IPv4 addresses and CIDRs, up to 64.
Set it on create, or change it with PATCH:
egressApplied is false for a sandbox created before network policies, with a message: the policy applies at its next start.
Snapshots
A snapshot saves a sandbox’s home directory (global installs, dotfiles, caches) and/workspace. Memory and running processes aren’t kept. Start new sandboxes from it to skip installs.
POST /sandboxes/{id}/snapshots takes an optional name. The sandbox must be running.
202
GET /sandboxes/snapshots/{snapshotId} until status is ready, or failed with an error. Then create a sandbox from it:
GET /sandboxes/snapshots lists your snapshots; ?sandboxId= keeps the ones taken from one sandbox. DELETE /sandboxes/snapshots/{snapshotId} deletes one.
Run a command
POST /sandboxes/{id}/exec
The sandbox must be running, or you get 409.
output holds stdout and stderr together. Very long output is cut and truncated is true.
Stream output
SendAccept: application/x-ndjson to get output as it’s produced, one JSON object per line:
exit, or error with a message if the command couldn’t run.
Files
Paths are inside the sandbox. Files are up to 2 MB.type is file or directory.
Binary files
Images, archives, and other binary files go base64-encoded. Addencoding=base64 to read one, and "encoding": "base64" to write one. The 2 MB limit applies to the decoded bytes.
Processes
GET /sandboxes/{id}/processes lists what’s running in the sandbox:
DELETE /sandboxes/{id}/processes/{pid}?signal=TERM sends a signal to a process and returns { "pid": 64, "signal": "TERM" }. signal is TERM (the default), KILL, INT, or HUP. You get 404 when there’s no such process.
Start, stop, and delete
Logs and usage
GET /sandboxes/{id}/logs returns provisioning events and the container’s recent output:
GET /sandboxes/{id}/usage returns what the sandbox has cost:
Account summary
GET /sandboxes/summary is the account at a glance. The dashboard, the CLI (pxxl sandbox summary) and the AI agent all read it.
runwayHoursis how long the wallet lasts at the current burn. It’snullwhen nothing is running.storageGbis the disk reserved by your sandboxes, paused ones included.- Hints:
idlemeans a running sandbox has had no activity for 15 minutes or more.runwaymeans the wallet covers less than 2 hours of the running sandboxes.
Private previews
Every sandbox has a preview URL. SetpreviewAccess when you create the sandbox, or later with PATCH:
public(the default): anyone with the URL can open it.private: the URL answers401unless the browser comes through a link fromPOST /sandboxes/{id}/preview-link.
Background commands
Add"background": true to start a long-running process, such as a dev server or a watcher, without waiting for it to finish:
{ "background": true, "pid": 46, "logFile": "/tmp/pxxl-bg/1795542369859626457.log" }. The process keeps running until the sandbox stops or you stop it. Read its output with another exec, for example tail -n 50 <logFile>.
Preview analytics
GET /sandboxes/{id}/analytics?timeframe=24h returns traffic to the sandbox’s preview URL: requests, unique visitors, bandwidth and status codes over time. It has the same shape as a project’s traffic analytics.
Alerts
Pxxl notifies whoever pays for the sandbox: you, or the spaceship owner for a team sandbox. Alerts appear in the dashboard and as push notifications, and the ones that need action also arrive by email. Each alert is sent at most once a day per sandbox.
Wallet lines for sandbox usage read like
Sandbox api-test · 2 vCPU · 4 GB · 3h 12m.
Terminal
POST /sandboxes/{id}/terminal/ticket returns a short-lived wsUrl for an interactive shell. Connect to it within expiresIn seconds. It works once.
The terminal is available when terminals are enabled for your account. Otherwise this route returns
403. pxxl sandbox terminal <id> connects for you.
