OpenapiSandbox
List sandbox
Lists the caller org's sandboxes, newest first. `?project=` and `?status=` narrow it.
GET /v1/sandbox
| Address | https://api.hanzo.ai/v1/sandbox |
| Method | GET |
| Operation | get_sandbox |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Lists the caller org's sandboxes, newest first.
?project= and ?status= narrow it. Only the caller's org's: the store is
keyed on the validated org, so another tenant's sandbox is not something this
operation can return.
Request
2 fields.
| Field | In | Type | Required | Description |
|---|---|---|---|---|
project | query | string | — | |
status | query | string | — |
Response
| Status | Body | Meaning |
|---|---|---|
200 | sandboxList | ok |
200 body — 15 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
sandboxes | body | Sandbox[] | — | Sandboxes are the caller org's sandboxes matching the filter. |
sandboxes[].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… |
sandboxes[].connectedAt | body | integer | — | ConnectedAt is when somebody was last known to have this sandbox's project OPEN, Unix seconds. |
sandboxes[].createdAt | body | integer | — | CreatedAt is when the lease was first taken, Unix seconds. |
sandboxes[].error | body | string | — | Error is why the sandbox could not come up, in plain words. |
sandboxes[].expiresAt | body | integer | — | ExpiresAt is when the lease ends, Unix seconds. |
sandboxes[].id | body | string | — | ID is the sandbox's server-minted handle and what every operation addresses it by. |
sandboxes[].image | body | string | — | Image is the container image this sandbox is actually running — the one the class chose, or an override the policy admitted. |
sandboxes[].kind | body | string | — | Kind is the resource family this row belongs to. |
sandboxes[].lastUsedAt | body | integer | — | LastUsedAt is when the sandbox last did work, Unix seconds. |
sandboxes[].org | body | string | — | Org is the org that holds the lease — the validated caller's, never a value a request supplied. |
sandboxes[].project | body | string | — | Project is the project this sandbox is bound to. |
sandboxes[].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… |
sandboxes[].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. |
sandboxes[].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 listimport { Configuration, SandboxApi } from 'hanzoai';
const api = new SandboxApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getSandbox();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).get_sandbox()cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.SandboxAPI.GetSandbox(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::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::get_sandbox(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.SandboxApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new SandboxApi(client).getSandbox();curl https://api.hanzo.ai/v1/sandbox \
-H "Authorization: Bearer $HANZO_API_KEY"Tool sandboxes, op get_sandbox — POST the JSON-RPC envelope to https://api.hanzo.ai/v1/mcp.
curl -X POST https://api.hanzo.ai/v1/mcp \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "sandboxes",
"arguments": {
"op": "get_sandbox",
"input": {}
}
}
}'How is this guide?