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

templateIDstringOptional

Filter by template ID. The aliases templateId and template are also accepted.

sandboxIDstringOptional

Filter by exact instance ID.

statestringOptional

Filter by state, for example running or paused.

limitintegerOptional

Number of items per page. Default: 20. Maximum: 50.

Response fields

Each array element contains the following fields.

clientIDstring

Client identifier.

sandboxIDstring

Unique instance ID.

bailianSandboxIdstring

Alibaba Cloud Model Studio extension identifier. Usually not needed by developers.

templateIDstring

Template ID.

aliasstring

Template alias.

statestring

Instance state, for example running.

cpuCountinteger

Number of vCPUs.

memoryMBinteger

Memory size in MB.

diskSizeMBinteger

Disk size in MB.

envdVersionstring

envd version.

startedAtstring

Instance start time in date-time format.

endAtstring

Instance expiry time in date-time format.

metadataobject

Custom metadata.

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"}
  }
]