Create a sandbox
/sandbox/v1/sandboxes● SupportedRequest body
templateIDstringrequiredIdentifier of the required template
timeoutintegeroptionalLifetime of the new sandbox in seconds. Defaults to 300 seconds when omitted.
autoPausebooleanoptionalLifecycle declaration on the E2B-compatible face. true creates a persistent sandbox that pauses at its timeout and can be resumed; false or absent creates an ephemeral sandbox that ends at its timeout and keeps nothing. Keep true only for long-lived computers. The own face declares with ephemeral instead.
metadataanyoptionalYour own string key/value pairs stored with the sandbox; usable as a filter in listSandboxes.
envVarsanyoptionalEnvironment variables as name to value string pairs.
allow_internet_accessbooleanoptionalAllow sandbox to access the internet. When set to false, it behaves the same as specifying denyOut to 0.0.0.0/0 in the network config.
autoPauseMemorybooleanoptionalControls the snapshot kind taken when the sandbox auto-pauses on timeout (only relevant when autoPause is true). When false, the auto-pause drops the in-memory state and persists only the filesystem (a filesystem-only snapshot); resuming it cold-boots (reboots) the sandbox from disk. Such a snapshot cannot be auto-resumed by traffic and must be resumed explicitly, so it cannot be combined with autoResume. Defaults to true (full memory snapshot).
autoResumeobjectoptionalAuto-resume configuration for paused sandboxes.
Expand sub-fields (1)
enabledbooleanrequiredAuto-resume enabled flag for paused sandboxes. Default false.
networkobjectoptionalNetwork policy of the sandbox: public access, egress allow and deny lists and proxy.
Expand sub-fields (9)
allowPublicTrafficbooleanoptionalSpecify if the sandbox URLs should be accessible only with authentication.
allowOutarrayoptionalList of allowed destinations for egress traffic. Each entry can be a CIDR block (e.g. "8.8.8.8/32"), a bare IP address (e.g. "8.8.8.8"), or a domain name (e.g. "example.com", "*.example.com"). Allowed entries always take precedence over denied entries.
denyOutarrayoptionalList of denied CIDR blocks or IP addresses for egress traffic. Domain names are not supported for deny rules.
egressProxyobjectoptionalSOCKS5 proxy for sandbox egress. Outbound TCP is tunneled through the proxy after allow/deny filtering; the sandbox is unaware. Domain-matched flows use remote DNS (ATYP=domain).
maskRequestHoststringoptionalSpecify host mask which will be used for all sandbox requests
httpsPortsarrayoptionalUnlike E2B, network.httpsPorts is rejected; omit it when creating a sandbox.
rulesobjectoptionalPer-domain transform rules applied to matching outbound HTTPS requests. Keys may be exact DNS names (for example, "api.example.com") or a leading wildcard (for example, ".example.com"), and are normalized to lowercase on write. Wildcards match subdomains at any depth but not the apex domain; a bare "" is invalid. Exact rules take precedence, followed by the longest matching wildcard suffix, and matching rule sets are not merged. Broad wildcards such as "*.com" are allowed and may expose transformed credentials to every matching destination the sandbox contacts. Rules do not grant network access; configure allowOut separately to permit the destination.
staticEgressIpbooleanoptionalOwn face, persistent sandboxes only (autoPause: true, or ephemeral: false): true gives the sandbox one fixed public egress IP for its whole life, held through pause and resume and released when the sandbox is deleted. Without it the egress IP is not stable: it changes when a spot machine is reclaimed, when a paused machine starts again, and when the machine is rebuilt. An ephemeral sandbox returns INVALID_PARAMS; the E2B face refuses the field; it is placed only on capacity that declares static IPs, and without such capacity the create does not start (it never falls back to a changing IP). Billed as the usage item sandbox:public_ip:hours from allocation to release, paused time included, plus outbound traffic as usual.
egressIpstringoptionalOwn face, read-only: the fixed public egress IP of a sandbox created with staticEgressIp: true, present once the machine has bound it; add this address to the IP allowlist of the service you call (for example a WeCom trusted IP list). Absent on a sandbox that did not ask for a static IP, because its public address can change.
mcpobjectoptionalMCP configuration for the sandbox
More parameters (14)
iamobjectoptionalSandbox workload identity configuration. A non-empty, valid tokens map enables workload identity for the sandbox.
Expand sub-fields (1)
tokensobjectoptionalNamed workload-token definitions, keyed by a caller-chosen token name.
volumeMountsarrayoptionalVolumes to mount into the sandbox, each with the volume name and the path inside the sandbox.
Expand sub-fields (2)
namestringrequiredName of the volume
pathstringrequiredPath of the volume
ephemeralbooleanoptionalOwn face, required unless sku is named: true for an ephemeral sandbox (ends at its timeout, never pauses, cannot be snapshotted), false for a persistent one (pauses, resumes, snapshots, mounts volumes). Leaving it out returns INVALID_PARAMS.
sizestringoptionalOwn face: the machine size, a SKU id such as base-2c4g or, for an android phone, android-2c4g. Omitted, the template's default size is used.
namestringoptionalOwn face: a display name for the sandbox, 1 to 64 characters. Omitted, one is generated from the template.
waitForReadybooleanoptionalOwn face, android phones only: keep the create open until the phone is running or 55 seconds have passed since the request arrived; running out is not an error and answers the state reached.
onExpirestringoptionalOwn face: what happens at the timeout. pause needs ephemeral: false; must agree with autoPause when both are sent.
idleTimeoutintegeroptionalOwn face, persistent sandboxes only: pause after this many milliseconds without activity; null turns the idle pause off.
idleActivitystringoptionalOwn face, persistent sandboxes only: whose activity resets idleTimeout. traffic (default) counts data-plane calls, preview traffic and live processes; caller counts only your own control-plane calls.
skustringoptionalOwn face: a demand-profile SKU <kind>.<image>.<size>, such as run.document.medium (someone waits; starts fast), job.base.large (background work that must not be cut off), batch.base.large (retried work that may be reclaimed) or computer.base.medium (keeps its disk). It fixes ephemeral, interruptible, size and the template, so those may be left out; any of them you also send must agree with it, otherwise the create fails with INVALID_PARAMS naming the field. The sandbox answers it back as sku and as the read-only label praxis.sku.
kindstringoptionalOwn face: the kind of sandbox you need, when you do not name a full sku. The sandbox completes <kind>.<image>.<size> from the template you start (its family, or custom for your own environment or snapshot) and the size you send, or medium. run is for work someone waits for (starts fast), job is background work that must not be cut off, batch is retried work that may be reclaimed (spot capacity), computer keeps its disk, and compat is the E2B-compatible persistent series. The kind fixes ephemeral and interruptible, so leave those out; if you also send them, or a sku of another kind, the create fails with INVALID_PARAMS naming the field. The light template always starts the light shell, whatever the kind says.
interruptiblebooleanoptionalOwn face, ephemeral sandboxes only: true says this sandbox may be reclaimed while it runs (a build or test you retry), which lets it run on cheaper spot capacity. A reclaimed sandbox ends with PROVIDER_FAILED; create it again. Absent or false keeps the usual capacity.
onLossstringoptionalOwn face, persistent sandboxes only: what happens when the provider loses the machine. fail (default) ends the sandbox; rebuild starts a new machine under the same id with its state lost.
outputsarrayoptionalOwn face: up to eight absolute paths to keep when the sandbox ends; each is packed as .tar.gz into File and listed on the killed event.
Expand sub-fields (1)
pathstringrequiredAbsolute path of a directory or file inside the sandbox.
Returns
201
Like E2B, creating without a templateID uses the default base template; to use another, pick a templateID from List templates. Every sandbox declares its lifecycle at creation. On the own face (X-Praxis-Face: own-v1) send ephemeral: true for an ephemeral sandbox (never pauses, deleted when it ends; for jobs) or ephemeral: false for a persistent one (pauses, snapshots, mounts volumes; for long-lived computers); leaving it out returns INVALID_PARAMS. The E2B-compatible face declares with autoPause: true is persistent, false or absent is ephemeral. Persistent-only fields (autoPause: true, onExpire: pause, autoPauseMemory, autoResume, idleTimeout, retention, volumes) need ephemeral: false. Choose persistent only for long-lived computers. Reaching a sandbox whose machine has ended returns SANDBOX_EXPIRED (410): its files are gone, create a new sandbox. To keep results, declare outputs: [{ path }] on the own face (up to eight absolute paths): on any ending except provider loss or a failed start each is stored in File as .tar.gz, and the killed event lists each fileId or why it was not kept; the E2B face refuses outputs. Responses echo ephemeral.
Errors follow the E2B format — see error codes
Request
curl
curl https://api.deepraxis.com/sandbox/v1/sandboxes \
-H "X-API-Key: $PRAXIS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"templateID":"node22","timeout":300,"ephemeral":false}'Python
import requests
api_key = "$PRAXIS_API_KEY"
# Call /sandbox/v1 directly over HTTP.
resp = requests.post(
"https://api.deepraxis.com/sandbox/v1/sandboxes",
headers={"X-API-Key": api_key},
json={"templateID": "node22", "timeout": 300, "ephemeral": False},
)
print(resp.status_code, resp.text)TypeScript
const apiKey = "$PRAXIS_API_KEY";
// Call /sandbox/v1 directly over HTTP.
const resp = await fetch(`https://api.deepraxis.com/sandbox/v1/sandboxes`, {
method: "POST",
headers: { "X-API-Key": apiKey, "Content-Type": "application/json" },
body: JSON.stringify({ templateID: "node22", timeout: 300, ephemeral: false }),
});
console.log(resp.status, await resp.text());Response 201
{
"templateID": "node22",
"sandboxID": "sbib2586b83c183533da70bced2",
"clientID": "i42g6lkj181tyvouozh1o",
"envdVersion": "0.9.0",
"envdAccessToken": "<access-token>",
"domain": "sandbox.praxisusercontent.com"
}Response
HTTP 201
The sandbox was created successfully
application/json
| Name | Type | Description |
|---|---|---|
| templateID | string | Identifier of the template from which is the sandbox created |
| sandboxID | string | Identifier of the sandbox |
| alias | string | Alias of the template |
| clientID | string | Identifier of the client |
| envdVersion | string | Version of the envd running in the sandbox |
| envdAccessToken | string | Access token used for envd communication |
| trafficAccessToken | string | Token required for accessing sandbox via proxy. |
| domain | string | Base domain where the sandbox traffic is accessible |
| machine | string | What kind of machine this sandbox is, so you can decide whether to drive it as a computer without knowing which vendor placed it. full: a complete environment that runs files, commands, terminals and background processes through the data plane — drive it as a computer. light: a light machine without that. none: a single-use box that is reachable but must not be driven as a computer. |