Skip to main content

Get sandbox

Retrieve the details of a specific instance, including resource specifications, data-plane access information, and network and lifecycle configuration. Compatible with the E2B get-sandbox protocol and corresponds to get_info() in the SDK.

Prerequisites

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

Endpoint

GET /sandboxes/{sandboxID} Retrieve the details of a specific instance. Compatible with the E2B get-sandbox protocol and corresponds to get_info() in the SDK. Returns 404 if the instance does not exist, with the message 沙箱实例不存在 (the sandbox instance does not exist). If no network or lifecycle configuration exists, the corresponding field is omitted or returned as an empty object.

Path parameters

ParameterRequiredTypeDescription
sandboxIDYesstringUnique instance ID.

Request example

curl -X GET "$BASE_URL/sandboxes/sbx-xxx" \
  -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

{
  "sandboxID": "sbx-xxx",
  "bailianSandboxId": "your-bailian-sandbox-id",
  "templateID": "your-template-id",
  "state": "running",
  "cpuCount": 1,
  "memoryMB": 2048,
  "envdVersion": "your-envd-version",
  "domain": "your-sandbox-domain",
  "envdAccessToken": "your-envd-access-token",
  "trafficAccessToken": "your-traffic-access-token",
  "envdUrl": "your-envd-url",
  "allowInternetAccess": true,
  "network": {
    "allowPublicTraffic": true,
    "allowOut": ["example.com"],
    "denyOut": ["10.0.0.0/8"]
  },
  "lifecycle": {
    "onTimeout": "pause",
    "autoResume": true
  }
}

Response fields

FieldTypeDescription
sandboxIDstringUnique instance ID.
bailianSandboxIdstringAlibaba Cloud Model Studio extension identifier. Usually not needed by developers.
templateIDstringTemplate ID.
statestringInstance state, for example running.
cpuCountintegerNumber of vCPUs.
memoryMBintegerMemory size in MB.
envdVersionstringenvd version.
domainstringData-plane access domain.
envdAccessTokenstringenvd access token.
trafficAccessTokenstringTraffic access token.
envdUrlstringenvd access URL.
allowInternetAccessbooleanWhether the instance can access the internet.
networkobjectInstance-level network configuration. Sub-fields: allowPublicTraffic (boolean, whether public traffic is allowed), allowOut (array<string>, egress allowlist), denyOut (array<string>, egress denylist). Omitted or returned as an empty object when no network configuration exists.
lifecycleobjectLifecycle configuration. Sub-fields: onTimeout (string, behavior on expiry, for example pause), autoResume (boolean, whether connecting to a paused instance resumes it automatically). Omitted or returned as an empty object when no lifecycle configuration exists.
Managed Agent API
Flow Agent API
RAG API
Long-term Memory
ParseX API
Security API
Framework Integration