Перейти к содержимому
На главную

Sandboxes

Это содержимое пока не доступно на вашем языке.

Use sandbox lifecycle APIs to create an isolated runtime, reconnect to it, pause it, extend its TTL, and delete it.

POST /sandboxes

Request body:

FieldTypeRequiredDescription
templateIDstringnoTemplate ID or official type such as base, code-interpreter, node, codex, or api-server. Empty uses the default base template. See the template guide for the public official list.
timeoutintegernoLifecycle TTL in seconds.
waitReadybooleannoWait until the sandbox is ready before returning.
metadataobjectnoKey/value metadata persisted as sandbox labels.
envVarsobjectnoEnvironment variables injected at creation.
autoPausebooleannoPause instead of kill when timeout expires.
autoResumebooleannoAllow router-triggered resume for paused sandboxes.
allowInternetAccessbooleannoE2B-style egress control.
network.allowPublicTrafficbooleannoRequire a preview traffic token when set to false.
network.allowInternetAccessbooleannoEgress control inside the network object.
network.allowOutstring[]noIPv4/CIDR egress allowlist.
network.denyOutstring[]noIPv4/CIDR egress denylist.
volumeMountsobject[]noRequest-level volume mounts, each as { "name": "...", "path": "/..." }.

Do not send timeoutMs, secure, mcp, or snake_case volume_mounts in the create request. timeout is seconds. Runtime command requests still use timeoutMs in milliseconds.

Terminal window
export SEACLOUD_API_BASE_URL="https://sandbox-service.real-cloud.seaart.ai/api/v1/sandbox"
curl -sS -X POST "$SEACLOUD_API_BASE_URL/sandboxes" \
-H "X-API-Key: $SEACLOUD_API_KEY" \
-H "Content-Type: application/json" \
--data '{
"timeout": 1800,
"waitReady": true,
"metadata": { "app": "agent" }
}'

Response:

{
"templateID": "tpl-base-...",
"sandboxID": "sandbox_...",
"envdAccessToken": "<opaque-token>",
"envdUrl": "https://sandbox-router.example/9000-sandbox_...",
"status": "running",
"state": "running",
"startedAt": "2026-06-10T08:55:50Z",
"activatedAt": "2026-06-10T08:55:50Z",
"endAt": "2026-06-10T09:25:50Z",
"timeline": []
}
GET /sandboxes

Common query parameters:

QueryDescription
stateOptional lifecycle state filter. Can be repeated or comma-separated.
metadata[key]Optional metadata filter.
limitPage size.
nextTokenPagination token from the previous response.
GET /sandboxes/:sandboxID

Returns detail, lifecycle timestamps, runtime access information, timeline, and optional diagnostic fields.

POST /sandboxes/:sandboxID/connect

Request body:

{
"timeout": 1800
}

The body and timeout field are required. timeout=0 keeps the existing TTL. A positive timeout resets the TTL from the connect time. timeoutMs is rejected on this control-plane route.

MethodPathDescription
POST/sandboxes/:sandboxID/pausePause runtime while preserving resumable state.
POST/sandboxes/:sandboxID/refreshesExtend lifetime using the platform default or duration.
POST/sandboxes/:sandboxID/timeoutSet TTL in seconds using { "timeout": 3600 }.
DELETE/sandboxes/:sandboxIDDelete the sandbox.

POST /sandboxes/:sandboxID/timeout also requires a JSON body with timeout; timeoutMs is rejected.

MethodPathDescription
GET/sandboxes/:sandboxID/logsLogs with limit, cursor, direction, level, and search.
GET/sandboxes/:sandboxID/metricsLatest metric snapshot for one sandbox.
GET/sandboxes/metricsBatch metric snapshots.