沙箱
列出进程
返回已观测到的进程信息,不代表完整的进程历史。只有观测到退出事件时才能确定 exitCode;连接断开或重启可能导致记录缺失,状态未知。每个进程最多保留 1 MiB / 1024 个输出片段,每个沙箱最多保留 4 MiB / 4096 个输出片段及 256 条进程记录。截断会明确标记。输出数据使用 base64 编码;时间戳为 Unix 毫秒。读取不会恢复已暂停的沙箱。
先调用「创建沙箱」,用返回的 sandboxID 替换 sbx_123。
GET
/sandbox/v1/sandboxes/{sandboxID}/processes● 支持请求参数
sandboxIDstring必填path: 沙箱 ID。
statestring可选query: live:运行中;exited:已退出;all:全部保留记录。默认 live。
返回
200
错误按 E2B 格式返回,参见 错误码
响应
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. |