Resume sandbox
Gives a parked sandbox a pod again: POST /v1/sandbox/:id/resume. The pod is NEW.
POST /v1/sandbox/{id}/resume
| Address | https://api.hanzo.ai/v1/sandbox/{id}/resume |
| Method | POST |
| Operation | post_sandbox_by_id_resume |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Gives a parked sandbox a pod again: POST /v1/sandbox/:id/resume.
The pod is NEW. Its name is minted fresh because a pod name is never reused (store.go), the volume it mounts is the one the row already names, and the credential is the RESUMING caller's rather than the one that took the lease — a session is short-lived and the one that parked it is gone.
Request
1 field.
| Field | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | ID is the sandbox to address, from the path. |
Response
| Status | Body | Meaning |
|---|---|---|
200 | sandbox.Sandbox | ok |
default | problem-details | refused |
200 body — 15 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
class | body | string | — | Class 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… |
cluster | body | string | — | Cluster is the attached cluster this sandbox runs on — the fleet-local name the lease named — or empty for the home cluster. |
connectedAt | body | integer (int64) | — | ConnectedAt is when somebody was last known to have this sandbox's project OPEN, Unix seconds. |
createdAt | body | integer (int64) | — | CreatedAt is when the lease was first taken, Unix seconds. |
error | body | string | — | Error is why the sandbox could not come up, in plain words. |
expiresAt | body | integer (int64) | — | ExpiresAt is when the lease ends, Unix seconds. |
id | body | string | — | ID is the sandbox's server-minted handle and what every operation addresses it by. |
image | body | string | — | Image is the container image this sandbox is actually running — the one the class chose, or an override the policy admitted. |
kind | body | string | — | Kind is the resource family this row belongs to. |
lastUsedAt | body | integer (int64) | — | LastUsedAt is when the sandbox last did work, Unix seconds. |
org | body | string | — | Org is the org that holds the lease — the validated caller's, never a value a request supplied. |
project | body | string | — | Project is the project this sandbox is bound to. |
runtime | body | string | — | Runtime 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… |
status | body | string | — | Status 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. |
volume | body | string | — | Volume is the persistent volume attached to the sandbox, when it has one. |
Failure carries the platform error shape — see Errors.
Examples
hanzo sandbox resume <id>import { Configuration, SandboxApi } from 'hanzoai';
const api = new SandboxApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postSandboxByIdResume({ id: 'id' });from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import SandboxApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = SandboxApi(client).post_sandbox_by_id_resume(id='id')cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)
resp, _, err := client.SandboxAPI.PostSandboxByIdResume(context.Background()).Execute()
if err != nil {
return err
}use hanzo_client::apis::{configuration::Configuration, sandbox_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = sandbox_api::post_sandbox_by_id_resume(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.SandboxApi;
ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));
var result = new SandboxApi(client).postSandboxByIdResume();The method above is the one at the current release of the document. [email protected] (npm) was generated from an earlier release, where this operation carried a different id, so it spells the method differently — regenerating the clients is what makes the two agree. SDKs →
curl -X POST https://api.hanzo.ai/v1/sandbox/<id>/resume \
-H "Authorization: Bearer $HANZO_API_KEY"MCP reaches sandbox through the sandboxes tool, which names its 19 operations with its own verbs — this one among them, under a name only MCP declares. describe explains any of them:
curl -X POST https://api.hanzo.ai/v1/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "describe",
"arguments": {
"op": "list_sandboxes"
}
}
}'How is this guide?