跳转到内容
EN

列出进程

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

GET/sandbox/v1/sandboxes/{sandboxID}/processes● 支持

请求参数

  • sandboxIDstring必填

    path: 沙箱 ID。

  • statestring可选

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

    取值 liveexitedall

返回

200

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

请求示例

curl
# 先调用「创建沙箱」,用返回的 sandboxID 替换 sbx_123。
curl "https://api.deepraxis.com/sandbox/v1/sandboxes/sbx_123/processes?state=all" \
  -H "X-API-Key: $PRAXIS_API_KEY"
Python
# 先调用「创建沙箱」,用返回的 sandboxID 替换 sbx_123。
import requests

api_key = "$PRAXIS_API_KEY"

# Call /sandbox/v1 directly over HTTP.
resp = requests.get(
    "https://api.deepraxis.com/sandbox/v1/sandboxes/sbx_123/processes?state=all",
    headers={"X-API-Key": api_key},
)
print(resp.status_code, resp.text)
TypeScript
// 先调用「创建沙箱」,用返回的 sandboxID 替换 sbx_123。
const apiKey = "$PRAXIS_API_KEY";

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

响应示例 200

{
  "processes": [
    {
      "processId": "live-360",
      "pid": 360,
      "config": {
        "cmd": "/bin/bash",
        "args": [
          "-l",
          "-c",
          "sudo -u user -H sh -c '. /etc/profile.d/praxis.sh; exec praxis-envd serve >>/praxis/logs/praxis-envd.log 2>&1'"
        ],
        "cwd": "/home/user"
      },
      "state": "running",
      "observed": false,
      "observationGap": true,
      "outputTruncated": false
    },
    {
      "processId": "obs-1",
      "pid": 1575,
      "tag": "docs-sample",
      "config": {
        "cmd": "/bin/sh",
        "args": [
          "-c",
          "printf 'docs sample\\n'"
        ]
      },
      "pty": false,
      "startedAt": "2026-10-23T01:37:52.206Z",
      "exitCode": 0,
      "exitedAt": "2026-10-23T01:37:52.208Z",
      "state": "exited",
      "observed": true,
      "observationGap": false,
      "outputTruncated": false
    }
  ]
}

响应

HTTP 200

Bounded observation with explicit completeness

application/json

名称 类型 说明
processes array<object> Processes of the sandbox: running ones and retained observations of exited ones, newest first.
processes[].processId string Id of the process: obs-<n> for a process whose start was observed, live-<pid> for one that was only seen running.
processes[].pid integer Operating-system process id inside the sandbox.
processes[].tag string Tag the process was started with; absent when none.
processes[].config object Command the process was started with.
processes[].pty boolean Whether the process runs in a pseudo-terminal; present for observed processes.
processes[].startedAt string Time at which the process start was observed, UTC.
processes[].exitedAt string Time at which the process exit was observed, UTC; absent until an exit was witnessed.
processes[].exitCode integer Exit code; present only when the exit was witnessed.
processes[].state string Current state of the process.
processes[].observed boolean Whether the platform watched this process start. False for a process that was only seen running.
processes[].observationGap boolean True when observation was interrupted, so output or the exit may be missing; the state can then be unknown.
processes[].outputTruncated boolean True when old output chunks were dropped to stay within the retention limits.