Hanzo AI
OpenapiSandbox

Create sandbox

Leases a sandbox — a real computer — for the caller's org. The class decides what it is for and therefore its image, working directory and isolation.

POST /v1/sandbox

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

Leases a sandbox — a real computer — for the caller's org.

The class decides what it is for and therefore its image, working directory and isolation. A dev or desktop sandbox is SINGLE-ATTACH per project, so asking twice for one project resumes the one that exists rather than paying for a second; an exec sandbox carries no project and is bounded per org instead, refused 429 past the ceiling because the caller's correct response is to wait.

Answers 201 with the sandbox as leased, which names the runtime it GOT — not the one that was asked for.

Request

5 fields, body application/json (required).

FieldInTypeRequiredDescription
classbodystringClass is what the sandbox is FOR: "exec" for a code-interpreter call, "dev" for a workspace bound to a project, "desktop" for one with a screen.
imagebodystringImage overrides the image the class would pick.
projectbodystringProject binds the sandbox to one of the org's projects.
runtimebodystringRuntime asks for an isolation: runc, gvisor, kata-clh or kata-fc.
ttlSecbodyintegerTTLSec is how long the lease runs before the reaper may take it, in seconds.

Response

StatusBodyMeaning
201Sandboxcreated

201 body — 14 fields.

FieldInTypeAlwaysDescription
classbodystringClass is what the sandbox is FOR, and it decides the image, the working directory and the isolation: "exec" for a code-interpreter call (workdir /mnt/data, no…
connectedAtbodyintegerConnectedAt is when somebody was last known to have this sandbox's project OPEN, Unix seconds.
createdAtbodyintegerCreatedAt is when the lease was first taken, Unix seconds.
errorbodystringError is why the sandbox could not come up, in plain words.
expiresAtbodyintegerExpiresAt is when the lease ends, Unix seconds.
idbodystringID is the sandbox's server-minted handle and what every operation addresses it by.
imagebodystringImage is the container image this sandbox is actually running — the one the class chose, or an override the policy admitted.
kindbodystringKind is the resource family this row belongs to.
lastUsedAtbodyintegerLastUsedAt is when the sandbox last did work, Unix seconds.
orgbodystringOrg is the org that holds the lease — the validated caller's, never a value a request supplied.
projectbodystringProject is the project this sandbox is bound to.
runtimebodystringRuntime is the isolation boundary this sandbox GOT, which is not always the one it asked for: a caller states a preference and runtimeFor answers with what the…
statusbodystringStatus is where the sandbox is in its life: "pending" while the pod is coming up, "running" once it can take work, "error" when it cannot.
volumebodystringVolume is the persistent volume attached to the sandbox, when it has one.

Failure carries the platform error shape — see Errors.

Examples

hanzo sandbox create

Sandbox API · All Hanzo APIs · Interactive reference

How is this guide?

On this page