E2B
复制沙箱
从运行中沙箱创建独立副本。
先调用「创建沙箱」,用返回的 sandboxID 替换 sbx_123。
POST
/e2b/sandboxes/{sandboxID}/fork● 支持请求参数
sandboxIDstring必填path:
timeoutinteger可选新副本的存活时间,单位为秒。
countinteger可选要创建的独立副本数。所有副本来自同一次快照,每个副本分别返回成功结果或错误。
返回
201
错误按 E2B 格式返回,参见 错误码
响应
HTTP 201
The sandbox was snapshotted and the forks were attempted; each entry reports one fork's outcome
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| [].sandbox | object | |
| [].sandbox.templateID | string | Identifier of the template from which is the sandbox created |
| [].sandbox.sandboxID | string | Identifier of the sandbox |
| [].sandbox.alias | string | Alias of the template |
| [].sandbox.clientID | string | Identifier of the client |
| [].sandbox.envdVersion | string | Version of the envd running in the sandbox |
| [].sandbox.envdAccessToken | string | Access token used for envd communication |
| [].sandbox.trafficAccessToken | string | Token required for accessing sandbox via proxy. |
| [].sandbox.domain | string | Base domain where the sandbox traffic is accessible |
| [].error | object | |
| [].error.code | integer | Error code |
| [].error.error_code | string | Machine-readable semantic error code. Not a closed set; initial values: sandbox_capacity_unavailable, sandbox_placement_timeout, sandbox_no_compatible_node, sandbox_create_failed, internal_server_error. |
| [].error.message | string | Error |