Troubleshooting
If requests fail, run zero doctor check-connector --env-name E2B_TOKEN or zero doctor check-connector --url https://api.e2b.app/sandboxes --method GET
How to Use
Official docs:
https://e2b.dev/docs/api-reference
1. Create a Sandbox
Create a new sandbox (ephemeral VM). The default template is a Debian-based image with common runtimes.
Write /tmp/e2b_create.json:
{
"templateID": "base"
}
curl -s -X POST "https://api.e2b.app/sandboxes" --header "Content-Type: application/json" --header "X-API-Key: $E2B_TOKEN" -d @/tmp/e2b_create.json
Response includes:
sandboxID— Use this in all subsequent requeststemplateID— Template the sandbox was created fromalias— Human-readable aliasclientID— Client identifier
With a longer timeout (seconds, default 300):
Write /tmp/e2b_create.json:
{
"templateID": "base",
"timeout": 900
}
curl -s -X POST "https://api.e2b.app/sandboxes" --header "Content-Type: application/json" --header "X-API-Key: $E2B_TOKEN" -d @/tmp/e2b_create.json
With metadata tags:
Write /tmp/e2b_create.json:
{
"templateID": "base",
"metadata": {
"purpose": "code-review",
"user": "agent"
}
}
curl -s -X POST "https://api.e2b.app/sandboxes" --header "Content-Type: application/json" --header "X-API-Key: $E2B_TOKEN" -d @/tmp/e2b_create.json
2. List Running Sandboxes
List all currently running sandboxes for your team:
curl -s -X GET "https://api.e2b.app/sandboxes" --header "X-API-Key: $E2B_TOKEN"
3. Get Sandbox Status
Get the status and details of a specific sandbox. Replace <sandbox-id> with the actual sandboxID from the create response:
curl -s -X GET "https://api.e2b.app/sandboxes/<sandbox-id>" --header "X-API-Key: $E2B_TOKEN"
4. Refresh Sandbox Timeout
Extend the running time of a sandbox before it auto-terminates. Replace <sandbox-id> with the actual sandbox ID:
Write /tmp/e2b_refresh.json:
{
"timeout": 300
}
curl -s -X POST "https://api.e2b.app/sandboxes/<sandbox-id>/refreshes" --header "Content-Type: application/json" --header "X-API-Key: $E2B_TOKEN" -d @/tmp/e2b_refresh.json
5. Kill a Sandbox
Terminate a sandbox immediately. Replace <sandbox-id> with the actual sandbox ID:
curl -s -X DELETE "https://api.e2b.app/sandboxes/<sandbox-id>" --header "X-API-Key: $E2B_TOKEN"
6. List Available Templates
List all sandbox templates available for your team:
curl -s -X GET "https://api.e2b.app/templates" --header "X-API-Key: $E2B_TOKEN"
Response includes:
templateID— Use this astemplateIDwhen creating sandboxesaliases— Human-readable names (e.g.base,python,nodejs)buildID— Current build identifier
Prerequisites
Connect the E2B connector at app.vm0.ai/connectors.
Troubleshooting: If requests fail, run
zero doctor check-connector --env-name E2B_TOKENorzero doctor check-connector --url https://api.e2b.app/sandboxes --method GET
Guidelines
- Sandbox lifecycle: Sandboxes are ephemeral and auto-terminate after the timeout (default 5 minutes). Always capture the
sandboxIDfrom the create response for subsequent operations. - Timeout management: Use the refresh endpoint to extend sandbox life if your task runs longer than expected.
- Template selection: Use
basefor general-purpose sandboxes. List templates first to see all available options including specialized Python/Node.js environments. - Metadata: Tag sandboxes with metadata to track purpose, user, or task — useful for auditing and cleanup.
- Cleanup: Always delete sandboxes when done to avoid unnecessary charges and hitting concurrency limits.
- Concurrency: Check your plan's sandbox concurrency limit before spawning many sandboxes simultaneously.