Hanzo
OpenapiSandbox

Lease a sandbox — a real computer — or resume one you hold

Leases the caller's sandbox, or returns the one it named if that lease is still running.

POST /v1/sandbox/lease

Addresshttps://api.hanzo.ai/v1/sandbox/lease
MethodPOST
Operationlease_sandbox
AuthAuthorization: Bearer $HANZO_API_KEY

Leases the caller's sandbox, or returns the one it named if that lease is still running.

What comes back is a real computer: a pod under a runtime boundary with a toolchain already in it, its own filesystem, and a lease that ends it. Every other op here acts on the one this returns.

Request

5 fields, body application/json (required).

FieldInTypeRequiredDescription
classbodystringClass is what KIND of computer to lease, and the set is closed: exec a throwaway one that keeps nothing. Seconds to minutes.
idbodystringID names a sandbox to RESUME, and is the id an earlier lease answered with. Empty asks for a new one.
projectbodystringProject names the disk to attach, and is REQUIRED for every class but exec.
runtimebodystringRuntime is the isolation boundary asked for: gvisor shares a filesystem and holds a project volume, kata-fc is a microVM that boots slower and reads files…
ttlSecbodyintegerTTLSec bounds the lease in seconds.

Response

StatusBodyMeaning
200Leasedok

200 body — 5 fields.

FieldInTypeAlwaysDescription
classbodystringClass is what was actually leased, from the closed set LeaseIn.Class names: exec | dev | desktop | android.
idbodystringID names this computer for every later call — run, read, write, stop and end all take it, and a LeaseIn carrying it resumes THIS sandbox instead of leasing a…
runtimebodystringRuntime is the boundary this sandbox GOT, which need not be the one asked for — carried for the same reason Workdir is, that it is a fact only the owner knows…
statusbodystringStatus is where the pod stands, from the store's three: pending | running | error.
workdirbodystringWorkdir is the absolute directory this sandbox keeps files in, and what a relative path in a later read, write or run resolves against — /work for dev, desktop…

Failure carries the platform error shape — see Errors.

Examples

hanzo sandboxes lease

Sandbox API · All Hanzo APIs · Interactive reference

How is this guide?

On this page