Create a sandbox
Start an isolated Linux machine (Ubuntu) to run code, commands and services in. Paid plans only.
The machine is private to this sandbox: it has no access to your Zavu account, to other sandboxes, or to anything you did not put in env.
Billing, from your balance: $0.01 when it is created, then machine time per second at the size's hourly price while it is starting or running, with a one-minute minimum per run. A sandbox that fails before it runs gets the $0.01 back. Running sandboxes are settled every five minutes, and one is stopped automatically when the balance or the monthly spend cap no longer covers 15 more minutes, when its timeoutSeconds passes, or when the team leaves its paid plan.
Answers 202 while it starts; poll GET /v1/sandboxes/{sandboxId} for running. Commands and file calls made while it is starting wait for it.
Not available with test-mode keys.
Authorization
AuthorizationheaderrequiredBearer YOUR_API_KEY. Create a key in the dashboard.
Body
application/json · optional
sizestringMachine size, and its price per hour of machine time: -
small: 2 vCPU, 4 GB RAM. $0.0225/h. -default: 4 vCPU, 8 GB RAM. $0.045/h. -large: 8 vCPU, 16 GB RAM. $0.09/h.One ofsmalldefaultlargeDefaultdefaulttimeoutSecondsintegerStop automatically after this many seconds. Max 24 hours.
nullturns auto-stop off: the sandbox runs until you stop it. It is still stopped when the balance or the monthly spend cap no longer covers 15 more minutes, or when the team leaves its paid plan, and it is billed for every second it runs.Default3600Limitsmin 60 · max 86400ephemeralbooleanNever save the disk. A stop erases it, so the sandbox cannot be resumed afterwards (
409 sandbox_expired). Use it for one-off jobs whose results you read before stopping.DefaultfalseenvobjectEnvironment variables set inside the machine. Keys match
[A-Za-z_][A-Za-z0-9_]{0,127}, at most 100 variables and 64 KB in total. A few platform names are reserved and refused with400.1 properties
{key}string
environmentstringName of one of the project's sandbox environments, created in the dashboard (Compute sandboxes › Environments). Its variables are set inside the machine;
envwins on the same name, and the two together must stay within theenvlimits. An unknown name answers404 not_foundand nothing is charged.Limitsmax length 64fromstringStart from a saved snapshot instead of a blank machine: the
idof one of this project's ready snapshots (GET /v1/sandbox-snapshots), or a share code (zsh_and 32 characters) another team gave you. The sandbox takes the snapshot's size, whateversizesays. From a share code you pay this sandbox's start and machine time, and the owner keeps paying for the snapshot. An unknown id or a revoked code answers404 not_found; a snapshot still saving answers409 snapshot_not_ready. Nothing is charged in either case.metadataobjectYour own labels, returned on the sandbox. At most 40 keys; each key is 1-64 characters from
A-Z a-z 0-9 . _ : -and starts with a letter or digit.1 properties
{key}stringLimitsmax length 512
idempotencyKeystringRetrying with the same key in this project returns
409with the sandbox the first request created, instead of creating and charging a second one.Limitsmax length 255namestringYour label for the sandbox, returned on it. Kept by Zavu only.
Limitsmax length 80setupScriptstringA script run with bash once the machine is ready, in the background, as its user (passwordless sudo). It does not delay the start, and its output is not returned: write to a file if you need it. At most 64 KB.
Limitsmax length 65536
Responses
202Accepted. The sandbox is starting.
sandboxobjectrequiredAn isolated Linux machine. It is billed per second while
startingorrunning(with a one-minute minimum per run), plus $0.01 each time it is created or resumed. A stopped sandbox costs nothing.17 properties
idstringrequirednamestringYour label for it, set with
nameon create. Copies keep their source's name.statusstringrequiredstarting: accepted, the machine is being prepared. Commands and file calls wait for it.running: the machine is up. Machine time is billed.stopping: a stop was requested; billing already ended.stopped: the disk is kept untilexpiresAt, andPOST /resumestarts it again. Not billed.failed: the machine could not start or failed on its host. SeefailureReason. A sandbox that fails before it ever runs gets its start fee back.
One ofstartingrunningstoppingstoppedfailedsizestringrequiredMachine size, and its price per hour of machine time: -
small: 2 vCPU, 4 GB RAM. $0.0225/h. -default: 4 vCPU, 8 GB RAM. $0.045/h. -large: 8 vCPU, 16 GB RAM. $0.09/h.One ofsmalldefaultlargetimeoutSecondsintegerrequiredThe sandbox is stopped automatically this many seconds after it started (or was last resumed). Checked every minute.
nullwhen auto-stop is off: it runs until you stop it, or until the balance, the spend cap or leaving the paid plan stops it.ephemeralbooleanrequiredCreated with
ephemeral: true. Its disk is never saved: a stop erases it,expiresAtis the moment it stopped, and resume answers409 sandbox_expired.metadataobjectrequiredWhat you attached when creating it. Kept by Zavu only; never visible inside the machine.
1 properties
{key}string
startedAtstring<date-time>When the current or last run was accepted.
stoppedAtstring<date-time>When the last run ended. Null while starting or running.
expiresAtstring<date-time>Present while
stopped: when the disk is deleted, 14 days after the stop, or the stop itself for an ephemeral sandbox. After it, resume answers409 sandbox_expired.stopReasonstringrequiredWhy the last run ended, while
stoppingorstopped; null otherwise.requested: you stopped it, from the API or the dashboard.timeout: itstimeoutSecondspassed.insufficient_balanceandspend_cap_reached: the balance or the monthly spend cap no longer covered 15 more minutes.plan: the team left its paid plan.provider: it ended on its host. Thesandbox.stoppedproject webhook carries the same value.One ofrequestedtimeoutinsufficient_balancespend_cap_reachedplanprovidernullcostTotalnumberrequiredUSD charged for this sandbox so far: start fees plus machine time. Machine time of a running sandbox is settled every five minutes, so this lags by up to five minutes until it stops.
failureReasonstringWhy it failed. Present only when
statusisfailed.forkedFromSandboxIdstringThe sandbox this one is a copy of, when it was made with
POST /v1/sandboxes/{sandboxId}/fork.fromSnapshotIdstringThe project's saved snapshot it started from. Null when it started blank, as a copy, or from another team's shared snapshot.
createdAtstring<date-time>requiredupdatedAtstring<date-time>required
400Invalid body, or the key is a test-mode key: sandboxes need a live key.
codestringrequiredmessagestringrequireddetailsobject
401Unauthorized.
codestringrequiredmessagestringrequireddetailsobject
402`paid_plan_required`: sandboxes need a paid plan, and Free cannot start one (`details.dashboardUrl` is `/upgrade`). `insufficient_balance`: the balance does not cover the $0.01 start fee plus 15 minutes of machine time at the sandbox's size. `spend_cap_reached`: the monthly spend cap does not leave that much room.
codestringrequiredmessagestringrequireddetailsobject
403`plan_limit_reached`: the team already has 10 sandboxes starting or running. `details.limit` and `details.running` say so.
codestringrequiredmessagestringrequireddetailsobject
404`not_found`: `environment` names no environment in this project, or `from` is not a share code of a ready snapshot (it was revoked, or the snapshot deleted). Nothing was charged.
codestringrequiredmessagestringrequireddetailsobject
409An idempotent replay: the `idempotencyKey` was already used in this project. Nothing was created or charged; the body is the sandbox the first request created, in its current state.
sandboxobjectrequiredAn isolated Linux machine. It is billed per second while
startingorrunning(with a one-minute minimum per run), plus $0.01 each time it is created or resumed. A stopped sandbox costs nothing.17 properties
idstringrequirednamestringYour label for it, set with
nameon create. Copies keep their source's name.statusstringrequiredstarting: accepted, the machine is being prepared. Commands and file calls wait for it.running: the machine is up. Machine time is billed.stopping: a stop was requested; billing already ended.stopped: the disk is kept untilexpiresAt, andPOST /resumestarts it again. Not billed.failed: the machine could not start or failed on its host. SeefailureReason. A sandbox that fails before it ever runs gets its start fee back.
One ofstartingrunningstoppingstoppedfailedsizestringrequiredMachine size, and its price per hour of machine time: -
small: 2 vCPU, 4 GB RAM. $0.0225/h. -default: 4 vCPU, 8 GB RAM. $0.045/h. -large: 8 vCPU, 16 GB RAM. $0.09/h.One ofsmalldefaultlargetimeoutSecondsintegerrequiredThe sandbox is stopped automatically this many seconds after it started (or was last resumed). Checked every minute.
nullwhen auto-stop is off: it runs until you stop it, or until the balance, the spend cap or leaving the paid plan stops it.ephemeralbooleanrequiredCreated with
ephemeral: true. Its disk is never saved: a stop erases it,expiresAtis the moment it stopped, and resume answers409 sandbox_expired.metadataobjectrequiredWhat you attached when creating it. Kept by Zavu only; never visible inside the machine.
1 properties
{key}string
startedAtstring<date-time>When the current or last run was accepted.
stoppedAtstring<date-time>When the last run ended. Null while starting or running.
expiresAtstring<date-time>Present while
stopped: when the disk is deleted, 14 days after the stop, or the stop itself for an ephemeral sandbox. After it, resume answers409 sandbox_expired.stopReasonstringrequiredWhy the last run ended, while
stoppingorstopped; null otherwise.requested: you stopped it, from the API or the dashboard.timeout: itstimeoutSecondspassed.insufficient_balanceandspend_cap_reached: the balance or the monthly spend cap no longer covered 15 more minutes.plan: the team left its paid plan.provider: it ended on its host. Thesandbox.stoppedproject webhook carries the same value.One ofrequestedtimeoutinsufficient_balancespend_cap_reachedplanprovidernullcostTotalnumberrequiredUSD charged for this sandbox so far: start fees plus machine time. Machine time of a running sandbox is settled every five minutes, so this lags by up to five minutes until it stops.
failureReasonstringWhy it failed. Present only when
statusisfailed.forkedFromSandboxIdstringThe sandbox this one is a copy of, when it was made with
POST /v1/sandboxes/{sandboxId}/fork.fromSnapshotIdstringThe project's saved snapshot it started from. Null when it started blank, as a copy, or from another team's shared snapshot.
createdAtstring<date-time>requiredupdatedAtstring<date-time>required
429`daily_limit_exceeded`: the team started 200 sandboxes today (creates and resumes both count). Resets at 00:00 UTC.
codestringrequiredmessagestringrequireddetailsobject
503`sandbox_unavailable`: no machine capacity right now. Nothing was charged for machine time; retry shortly.
codestringrequiredmessagestringrequireddetailsobject