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
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.
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. |