all or sandbox with read_write. The client’s teamId applies to every sandbox call.
Create and use a sandbox
create() returns a Sandbox handle. The sandbox starts as creating, so wait for it before running commands.
- Node.js
- Python
Stream command output
Pass a callback to get output as it’s produced. The call still resolves with the exit code once the command ends. If the Gateway answers with plain JSON instead of a stream, the callback gets the whole output once.- Node.js
- Python
Labels
Labels are up to 20key: value pairs. Filter the list by them, and replace them on a handle.
- Node.js
- Python
Network policies
Choose what a sandbox can reach. Leaveegress out for the whole internet, block everything with deny-all, or pass an allow list of domains (github.com, *.npmjs.org) and public IPv4 CIDRs.
- Node.js
- Python
egressApplied is false for a sandbox created before network policies: the change applies at its next start. An invalid entry (a private range, an internal name, more than 64 entries, an empty allowlist) is a PxxlAPIError with status 400; 409 means the server can’t enforce policies.
Snapshots
Save a running sandbox’s home directory (global installs, dotfiles) and/workspace, then start new sandboxes from it with the installs already done. Memory and running processes aren’t kept. snapshot() waits until the snapshot is ready (about 5 to 15 seconds) unless you pass wait: false, and throws SandboxSnapshotError if saving fails.
- Node.js
- Python
details.sandboxIds lists them. With wait: false (wait=False), poll with pxxl.sandboxes.snapshots.waitUntilReady(snapshot) or get(id). See the snapshot object.
Fast starts
Default-sizenode, python, and base sandboxes start from a warm pool in about 2 seconds, so waitUntilReady() usually returns almost at once. Nothing to configure.
Background processes
Start a server or watcher withbackground, see it in the process list, and stop it with a signal.
- Node.js
- Python
kill() throws PxxlAPIError with status 404 when there’s no such process.
Binary files
Write bytes and they go base64-encoded; read withbinary to get bytes back. Strings are written as text.
- Node.js
- Python
The sandbox handle
Read fields from the handle:
id, name, status, template, labels, egress, domain, hourlyUsd, isRunning, isPaused, and info for the full sandbox object. In Python, info is a dict and the flags are is_running and is_paused. Fields reflect the last fetch; call refresh() for current ones.
The sandboxes resource
Create options:
name, template (base, node, python, go, rust, bun; see templates), size (micro, small, medium, large), cpus, memoryMb, diskGb (2, 5, 10), autoStopMinutes (0 to 1440), env, sourceRepository, previewAccess, labels, egress ({ mode?, allow? }), snapshotId (start from a snapshot; the template comes from it), and teamId. Python takes the same options in snake case. template defaults to base (Debian 13).
pxxl.sandboxes also has ID-based methods, such as exec(id, command) and readFile(id, path), if you don’t want a handle.
Errors
API errors throwPxxlAPIError in both SDKs, with the HTTP status. A plan or wallet problem has upgradeRequired (upgrade_required in Python) set. See errors.

