跳转到内容
EN

列出沙箱

GET/sandbox/v1/sandboxes● 支持

E2B 官方文档 ↗

请求参数

  • metadatastring可选

    query: Metadata query used to filter the sandboxes (e.g. "user=abc&app=prod"). Each key and values must be URL encoded.

  • statearray可选

    query: live:运行中;exited:已退出;all:全部保留记录。默认 live。

  • orderstring可选
    默认 "desc"

    query: Sort direction by sandbox start time. Defaults to desc (newest first).

    取值 ascdesc
  • startedAfterstring可选

    query: Return sandboxes started at or after this timestamp.

  • templatestring可选

    query: Filter sandboxes by a template ID or alias.

  • nextTokenstring可选

    query: Cursor to start the list from

  • limitinteger可选
    默认 100

    query: Maximum number of items to return per page

  • namestring可选

    query: 按名称子串搜索,不区分大小写;中文、%、_ 和反斜杠按原样匹配。去除首尾空白后须为 1–64 个字符。可与状态及分页参数组合;历史空名称不匹配。

返回

200

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

请求示例

curl
curl https://api.deepraxis.com/sandbox/v1/sandboxes \
  -H "X-API-Key: $PRAXIS_API_KEY"
Python
import requests

api_key = "$PRAXIS_API_KEY"

# Call /sandbox/v1 directly over HTTP.
resp = requests.get(
    "https://api.deepraxis.com/sandbox/v1/sandboxes",
    headers={"X-API-Key": api_key},
)
print(resp.status_code, resp.text)
TypeScript
const apiKey = "$PRAXIS_API_KEY";

// Call /sandbox/v1 directly over HTTP.
const resp = await fetch(`https://api.deepraxis.com/sandbox/v1/sandboxes`, {
  headers: { "X-API-Key": apiKey },
});
console.log(resp.status, await resp.text());

响应示例 200

[
  {
    "templateID": "node22",
    "sandboxID": "sbib2586b83c183533da70bced2",
    "clientID": "i42g6lkj181tyvouozh1o",
    "startedAt": "2026-10-04T15:32:41.819Z",
    "endAt": "2026-10-04T15:37:41.458Z",
    "state": "running",
    "cpuCount": 1,
    "memoryMB": 1983,
    "diskSizeMB": 24242,
    "envdVersion": "0.9.0",
    "metadata": {},
    "volumeMounts": []
  }
]

响应

HTTP 200

Successfully returned all running sandboxes

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
[].cpuCount integer Requested virtual CPU count; a positive integer, default 2 for template builds.
[].memoryMB integer Requested build memory in MiB; a positive integer, default 1024.
[].diskSizeMB integer Disk size for the sandbox in MiB
[].metadata any Your own string key/value pairs stored with the sandbox; usable as a filter in listSandboxes.
[].state string running while the sandbox's machine is up and drivable, paused while it is stopped and can be resumed. On the own face an android phone (templateID "android") has three device states of its own, because its machine running is not yet the phone program's readiness: starting while the vendor is still building the machine, booting while the machine runs but the phone program has not connected on the sandbox's control connection, and running once it has. Its detail and list rows also carry readyAt, the epoch-milliseconds instant the program said hello, null until it does; a linux sandbox only ever reads running or paused.
[].envdVersion string Version of the envd running in the sandbox
[].volumeMounts array<object> Volumes mounted into the sandbox.
[].volumeMounts[].name string Name of the volume
[].volumeMounts[].path string Path of the volume
[].machine string What kind of machine this sandbox is, so you can decide whether to drive it as a computer without knowing which vendor placed it. full: a complete environment that runs files, commands, terminals and background processes through the data plane — drive it as a computer. light: a light machine without that. none: a single-use box that is reachable but must not be driven as a computer.