Skip to main content

List sandboxes

List the sandbox instances in the current workspace, with optional filtering by template ID, instance ID, and state. Compatible with the E2B list-sandboxes protocol.

Prerequisites

Configure the endpoint and authentication first. See API overview and authentication.

Endpoint

GET /v2/sandboxes List the sandbox instances in the current workspace. Compatible with the E2B list-sandboxes protocol; the route GET /sandboxes is also supported.

Query parameters

ParameterRequiredTypeDescription
templateIDNostringFilter by template ID. The aliases templateId and template are also accepted.
sandboxIDNostringFilter by exact instance ID.
stateNostringFilter by state, for example running or paused.
limitNointegerNumber of items per page. Default: 20. Maximum: 50.

Request example

curl -X GET "$BASE_URL/v2/sandboxes?state=running&limit=20" \
  -H "Authorization: Bearer $BAILIAN_API_KEY"
BASE_URL is https://{workspace_id}.cn-beijing.maas.aliyuncs.com/api/v1/agentstudio/sandbox, and BAILIAN_API_KEY is your Alibaba Cloud Model Studio API key.

Response example

The response body is an array of instances rather than a paginated object.
[
  {
    "clientID": "your-client-id",
    "sandboxID": "sbx-xxx",
    "bailianSandboxId": "your-bailian-sandbox-id",
    "templateID": "your-template-id",
    "alias": "your-template-alias",
    "state": "running",
    "cpuCount": 1,
    "memoryMB": 2048,
    "diskSizeMB": 10240,
    "envdVersion": "your-envd-version",
    "startedAt": "2026-01-01T00:00:00Z",
    "endAt": "2026-01-01T01:00:00Z",
    "metadata": {"team": "data"}
  }
]

Response fields

Each array element contains the following fields.
FieldTypeDescription
clientIDstringClient identifier.
sandboxIDstringUnique instance ID.
bailianSandboxIdstringAlibaba Cloud Model Studio extension identifier. Usually not needed by developers.
templateIDstringTemplate ID.
aliasstringTemplate alias.
statestringInstance state, for example running.
cpuCountintegerNumber of vCPUs.
memoryMBintegerMemory size in MB.
diskSizeMBintegerDisk size in MB.
envdVersionstringenvd version.
startedAtstringInstance start time in date-time format.
endAtstringInstance expiry time in date-time format.
metadataobjectCustom metadata.
Managed Agent API
Flow Agent API
RAG API
Long-term Memory
ParseX API
Security API
Framework Integration