Connect to a sandbox
Call Create sandbox first and replace sbx_123 with its returned sandboxID.
/e2b/sandboxes/{sandboxID}/connect● SupportedRequest parameters
sandboxIDstringrequiredpath:
timeoutintegerrequiredTimeout in seconds from the current time after which the sandbox should expire
memorybooleanoptionalDefaults 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.
Returns
201
Deprecated: the latest official SDK uses v2.
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/connect \
-H "X-API-Key: $PRAXIS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"timeout":300}'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",
)
sandbox = Sandbox.connect("sbx_123", timeout=300, **opts)
print(sandbox.sandbox_id)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 sandbox = await Sandbox.connect("sbx_123", { ...opts, timeoutMs: 300_000 });
console.log(sandbox.sandboxId);Response 201
{
"templateID": "node22",
"sandboxID": "sbib185b70d57718fd1f3df06d4",
"clientID": "iuf9ho516lcexp7svm6td",
"envdVersion": "0.9.0",
"envdAccessToken": "<access-token>",
"domain": "sandbox.praxisusercontent.com"
}Response
HTTP 200
The sandbox was already running
application/json
| Name | Type | Description |
|---|---|---|
| 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
| Name | Type | Description |
|---|---|---|
| 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 |