Fork a sandbox
Call Create sandbox first and replace sbx_123 with its returned sandboxID.
POST
/e2b/sandboxes/{sandboxID}/fork● SupportedRequest parameters
sandboxIDstringrequiredpath:
timeoutintegeroptionalTime to live for each fork in seconds.
countintegeroptionalNumber of independent forks from one snapshot; each entry reports its own result or error.
Returns
201
Errors follow the E2B format — see error codes
Request
curl
# Call Create sandbox first and replace sbx_123 with its returned sandboxID.
curl https://api.deepraxis.com/e2b/sandboxes/sbx_123/fork \
-H "X-API-Key: $PRAXIS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"count":1}'Python
# Call Create sandbox first and replace sbx_123 with its returned sandboxID.
from e2b import Sandbox
opts = dict(
api_key="$PRAXIS_API_KEY",
api_url="https://api.deepraxis.com/e2b",
domain="sandbox.praxisusercontent.com",
)
children = Sandbox.fork("sbx_123", count=1, **opts)
print(children)TypeScript
// Call Create sandbox first and replace sbx_123 with its returned sandboxID.
import { Sandbox } from "e2b";
const opts = {
apiKey: "$PRAXIS_API_KEY",
apiUrl: "https://api.deepraxis.com/e2b",
domain: "sandbox.praxisusercontent.com",
};
const children = await Sandbox.fork("sbx_123", { ...opts, count: 1 });
console.log(children);Response 201
[
{
"sandbox": {
"templateID": "node22",
"sandboxID": "sbia970bfef1c540f18f7a4f4da",
"clientID": "iyhdmes2si5kag4oj015m",
"envdVersion": "0.9.0",
"envdAccessToken": "<access-token>",
"domain": "sandbox.praxisusercontent.com"
}
}
]Response
HTTP 201
The sandbox was snapshotted and the forks were attempted; each entry reports one fork’s outcome
application/json
| Name | Type | Description |
|---|---|---|
| [].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 |