List sandboxes
Updated at:
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
| Parameter | Required | Type | Description |
|---|---|---|---|
templateID | No | string | Filter by template ID. The aliases templateId and template are also accepted. |
sandboxID | No | string | Filter by exact instance ID. |
state | No | string | Filter by state, for example running or paused. |
limit | No | integer | Number 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.
| Field | Type | Description |
|---|---|---|
clientID | string | Client identifier. |
sandboxID | string | Unique instance ID. |
bailianSandboxId | string | Alibaba Cloud Model Studio extension identifier. Usually not needed by developers. |
templateID | string | Template ID. |
alias | string | Template alias. |
state | string | Instance state, for example running. |
cpuCount | integer | Number of vCPUs. |
memoryMB | integer | Memory size in MB. |
diskSizeMB | integer | Disk size in MB. |
envdVersion | string | envd version. |
startedAt | string | Instance start time in date-time format. |
endAt | string | Instance expiry time in date-time format. |
metadata | object | Custom metadata. |
Is this page helpful?