Skip to content
中文

Fork a sandbox

Call Create sandbox first and replace sbx_123 with its returned sandboxID.

POST/sandbox/v1/sandboxes/{sandboxID}/fork● Supported

Official E2B docs ↗

Request parameters

  • sandboxIDstringrequired

    path: Sandbox ID.

  • timeoutintegeroptional
    default 15

    Time to live for each fork in seconds.

  • countintegeroptional
    default 1

    Number 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/sandbox/v1/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.
import requests

api_key = "$PRAXIS_API_KEY"

# Call /sandbox/v1 directly over HTTP.
resp = requests.post(
    "https://api.deepraxis.com/sandbox/v1/sandboxes/sbx_123/fork",
    headers={"X-API-Key": api_key},
    json={"count": 1},
)
print(resp.status_code, resp.text)
TypeScript
// Call Create sandbox first and replace sbx_123 with its returned sandboxID.
const apiKey = "$PRAXIS_API_KEY";

// Call /sandbox/v1 directly over HTTP.
const resp = await fetch(`https://api.deepraxis.com/sandbox/v1/sandboxes/sbx_123/fork`, {
  method: "POST",
  headers: { "X-API-Key": apiKey, "Content-Type": "application/json" },
  body: JSON.stringify({ count: 1 }),
});
console.log(resp.status, await resp.text());

Response 201

[
  {
    "sandbox": {
      "templateID": "node22",
      "sandboxID": "sbia61f57b1656b1d1dda4e017c",
      "clientID": "ilw3r38pwlahgkvdu85yc",
      "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 created from a template.
[].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
[].sandbox.machine string What kind of machine this sandbox is, so you can decide whether to drive it as a computer without knowing which vendor placed it. full: a complete environment that runs files, commands, terminals and background processes through the data plane — drive it as a computer. light: a light machine without that. none: a single-use box that is reachable but must not be driven as a computer.
[].error object Error body: numeric code, machine-readable error_code and a message.
[].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 Human-readable description of the error.