跳转到内容
EN

读取沙箱

先调用「创建沙箱」,用返回的 sandboxID 替换 sbx_123。

GET/e2b/sandboxes/{sandboxID}● 支持

E2B 官方文档 ↗

请求参数

  • sandboxIDstring必填

    path:

返回

200

错误按 E2B 格式返回,参见 错误码

请求示例

curl
# 先调用「创建沙箱」,用返回的 sandboxID 替换 sbx_123。
curl https://api.deepraxis.com/e2b/sandboxes/sbx_123 \
  -H "X-API-Key: $PRAXIS_API_KEY"
Python
# 先调用「创建沙箱」,用返回的 sandboxID 替换 sbx_123。
from e2b import Sandbox

opts = dict(
    api_key="$PRAXIS_API_KEY",
    api_url="https://api.deepraxis.com/e2b",
    domain="sandbox.praxisusercontent.com",
)

info = Sandbox.get_info("sbx_123", **opts)
print(info.state)
TypeScript
// 先调用「创建沙箱」,用返回的 sandboxID 替换 sbx_123。
import { Sandbox } from "e2b";

const opts = {
  apiKey: "$PRAXIS_API_KEY",
  apiUrl: "https://api.deepraxis.com/e2b",
  domain: "sandbox.praxisusercontent.com",
};

const info = await Sandbox.getInfo("sbx_123", opts);
console.log(info.state);

响应示例 200

{
  "sandboxID": "sbib185b70d57718fd1f3df06d4",
  "templateID": "node22",
  "clientID": "iuf9ho516lcexp7svm6td",
  "startedAt": "2026-10-04T15:32:41.457Z",
  "endAt": "2026-10-04T15:37:40.907Z",
  "state": "running",
  "cpuCount": 1,
  "memoryMB": 1983,
  "diskSizeMB": 24242,
  "envdVersion": "0.9.0",
  "envdAccessToken": "<access-token>",
  "domain": "sandbox.praxisusercontent.com",
  "metadata": {},
  "allowInternetAccess": null,
  "volumeMounts": []
}

响应

HTTP 200

Successfully returned the sandbox

application/json

名称 类型 说明
templateID string Identifier of the template from which is the sandbox created
alias string Alias of the template
sandboxID string Identifier of the sandbox
clientID string Identifier of the client
startedAt string Time when the sandbox was started
endAt string Time when the sandbox will expire
envdVersion string Version of the envd running in the sandbox
envdAccessToken string Access token used for envd communication
allowInternetAccess boolean Whether internet access was explicitly enabled or disabled for the sandbox. Null means it was not explicitly set.
domain string Base domain where the sandbox traffic is accessible
cpuCount integer CPU cores for the sandbox
memoryMB integer Memory for the sandbox in MiB
diskSizeMB integer Disk size for the sandbox in MiB
metadata any
state string State of the sandbox
network object
network.allowPublicTraffic boolean Specify if the sandbox URLs should be accessible only with authentication.
network.allowOut array<string> List of allowed destinations for egress traffic. Each entry can be a CIDR block (e.g. "8.8.8.8/32"), a bare IP address (e.g. "8.8.8.8"), or a domain name (e.g. "example.com", "*.example.com"). Allowed entries always take precedence over denied entries.
network.denyOut array<string> List of denied CIDR blocks or IP addresses for egress traffic. Domain names are not supported for deny rules.
network.egressProxy object SOCKS5 proxy for sandbox egress. Outbound TCP is tunneled through the proxy after allow/deny filtering; the sandbox is unaware. Domain-matched flows use remote DNS (ATYP=domain).
network.maskRequestHost string Specify host mask which will be used for all sandbox requests
network.httpsPorts array<integer> Sandbox ports that serve HTTPS rather than plaintext HTTP. Affects how the proxy reaches the service inside the sandbox; the public URL is HTTPS either way. Certificates are not verified, so self-signed ones work. The envd port (49983) cannot be listed.
network.rules object Per-domain transform rules applied to matching outbound HTTPS requests. Keys may be exact DNS names (for example, "api.example.com") or a leading wildcard (for example, ".example.com"), and are normalized to lowercase on write. Wildcards match subdomains at any depth but not the apex domain; a bare "" is invalid. Exact rules take precedence, followed by the longest matching wildcard suffix, and matching rule sets are not merged. Broad wildcards such as "*.com" are allowed and may expose transformed credentials to every matching destination the sandbox contacts. Rules do not grant network access; configure allowOut separately to permit the destination.
lifecycle object Sandbox lifecycle policy returned by sandbox info.
lifecycle.autoResume boolean Whether the sandbox can auto-resume.
lifecycle.onTimeout string Action taken when the sandbox times out.
volumeMounts array<object>
volumeMounts[].name string Name of the volume
volumeMounts[].path string Path of the volume