E2B
连接沙箱(v2)
v2 路径的连接沙箱,请求与返回和 v1 相同。
先调用「创建沙箱」,用返回的 sandboxID 替换 sbx_123。
POST
/e2b/v2/sandboxes/{sandboxID}/connect● 支持请求参数
sandboxIDstring必填path:
timeoutinteger可选Timeout in seconds from the current time after which the sandbox should expire
memoryboolean可选Defaults to true. When false and the sandbox is paused, resume from disk state only: the sandbox cold-boots fresh and any memory in the snapshot is ignored, never modified or deleted. Disk state has crash-recovery semantics — writes not flushed before the pause may be lost. A no-op for snapshots that contain no memory. Rejected with an error in environments where this capability is not enabled, never silently downgraded to a memory restore.
返回
200
错误按 E2B 格式返回,参见 错误码
响应
HTTP 200
The sandbox was already running
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| templateID | string | Identifier of the template from which is the sandbox created |
| sandboxID | string | Identifier of the sandbox |
| alias | string | Alias of the template |
| clientID | string | Identifier of the client |
| envdVersion | string | Version of the envd running in the sandbox |
| envdAccessToken | string | Access token used for envd communication |
| trafficAccessToken | string | Token required for accessing sandbox via proxy. |
| domain | string | Base domain where the sandbox traffic is accessible |
HTTP 201
The sandbox was resumed successfully
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| templateID | string | Identifier of the template from which is the sandbox created |
| sandboxID | string | Identifier of the sandbox |
| alias | string | Alias of the template |
| clientID | string | Identifier of the client |
| envdVersion | string | Version of the envd running in the sandbox |
| envdAccessToken | string | Access token used for envd communication |
| trafficAccessToken | string | Token required for accessing sandbox via proxy. |
| domain | string | Base domain where the sandbox traffic is accessible |