E2B

复制沙箱

从运行中沙箱创建独立副本。

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

POST /e2b/sandboxes/{sandboxID}/fork● 支持

E2B 官方文档 ↗

请求参数

  • sandboxIDstring必填

    path:

  • timeoutinteger可选
    默认 15

    新副本的存活时间,单位为秒。

  • countinteger可选
    默认 1

    要创建的独立副本数。所有副本来自同一次快照,每个副本分别返回成功结果或错误。

返回

201

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

响应

HTTP 201

The sandbox was snapshotted and the forks were attempted; each entry reports one fork's outcome

application/json

名称类型说明
[].sandboxobject
[].sandbox.templateIDstringIdentifier of the template from which is the sandbox created
[].sandbox.sandboxIDstringIdentifier of the sandbox
[].sandbox.aliasstringAlias of the template
[].sandbox.clientIDstringIdentifier of the client
[].sandbox.envdVersionstringVersion of the envd running in the sandbox
[].sandbox.envdAccessTokenstringAccess token used for envd communication
[].sandbox.trafficAccessTokenstringToken required for accessing sandbox via proxy.
[].sandbox.domainstringBase domain where the sandbox traffic is accessible
[].errorobject
[].error.codeintegerError code
[].error.error_codestringMachine-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.messagestringError