E2B Compatibility
Lelantos implements the E2B REST API surface. Sandbox lifecycle (create, kill, timeout) is compatible. SDK command execution and process streaming are not yet supported.
Lelantos implements the E2B REST API surface for sandbox lifecycle management. You can create, list, kill, and set timeouts on sandboxes using the E2B SDK or REST API.
Not a drop-in replacement yet. SDK features that connect directly to the sandbox VM — commands.run(), process.start(), files.read()/files.write(), and getLogs() — are not fully compatible. Use the Lelantos REST API (/sandboxes/{id}/exec, /sandboxes/{id}/files) for those operations, or wait for full SDK parity.
Migration in Two Steps
- Get a Lelantos API key — sign up at lelantos.ai and create a key (starts with
lel_). - Change the domain — point the E2B SDK at
lelantos.aiinstead ofe2b.dev.
Quick Start
from e2b import Sandbox
sandbox = Sandbox.create(
template="base",
api_key="lel_your_key_here",
api_url="https://lelantos.ai",
domain="lelantos.ai",
)
sandbox.files.write("/hello.txt", "Hello from Lelantos!")
content = sandbox.files.read("/hello.txt")
print(content)
sandbox.kill()import { Sandbox } from "e2b";
const sandbox = await Sandbox.create({
template: "base",
apiKey: "lel_your_key_here",
apiUrl: "https://lelantos.ai",
domain: "lelantos.ai",
});
await sandbox.files.write("/hello.txt", "Hello from Lelantos!");
const content = await sandbox.files.read("/hello.txt");
console.log(content);
await sandbox.kill();Before & After
# Before (E2B)
from e2b import Sandbox
sandbox = Sandbox.create(api_key="e2b_key")
sandbox.files.write("/hello.txt", "Hello!")
sandbox.kill()
# After (Lelantos) — add api_url and domain
from e2b import Sandbox
sandbox = Sandbox.create(
template="base",
api_key="lel_key",
api_url="https://lelantos.ai",
domain="lelantos.ai",
)
sandbox.files.write("/hello.txt", "Hello!")
sandbox.kill()// Before (E2B)
import { Sandbox } from "e2b";
const sandbox = await Sandbox.create({ apiKey: "e2b_key" });
await sandbox.files.write("/hello.txt", "Hello!");
await sandbox.kill();
// After (Lelantos) — add apiUrl and domain
import { Sandbox } from "e2b";
const sandbox = await Sandbox.create({
template: "base",
apiKey: "lel_key",
apiUrl: "https://lelantos.ai",
domain: "lelantos.ai",
});
await sandbox.files.write("/hello.txt", "Hello!");
await sandbox.kill();Run Commands
result = sandbox.commands.run("echo Hello && uname -s")
print(result.stdout) # Hello\nLinux
print(result.stderr) # (empty)
print(result.exit_code) # 0const result = await sandbox.commands.run("echo Hello && uname -s");
console.log(result.stdout); // Hello\nLinux
console.log(result.stderr); // (empty)
console.log(result.exitCode); // 0File Operations
# Write
sandbox.files.write("/tmp/data.txt", "some data")
# Read
content = sandbox.files.read("/tmp/data.txt")
# List
entries = sandbox.files.list("/tmp")
for entry in entries:
print(entry.name)// Write
await sandbox.files.write("/tmp/data.txt", "some data");
// Read
const content = await sandbox.files.read("/tmp/data.txt");
// List
const entries = await sandbox.files.list("/tmp");
for (const entry of entries) {
console.log(entry.name);
}REST API (No SDK)
For full control without the E2B SDK:
import os
import requests
API_KEY = os.environ["LELANTOS_API_KEY"]
BASE = "https://api.lelantos.ai"
headers = {"X-API-Key": API_KEY, "Content-Type": "application/json"}
# Create
resp = requests.post(f"{BASE}/sandboxes", headers=headers, json={"templateID": "base"})
sandbox_id = resp.json()["sandboxID"]
# List
sandboxes = requests.get(f"{BASE}/sandboxes", headers=headers).json()
# Kill
requests.delete(f"{BASE}/sandboxes/{sandbox_id}", headers=headers)const API_KEY = process.env.LELANTOS_API_KEY;
const BASE = "https://api.lelantos.ai";
const headers = { "X-API-Key": API_KEY, "Content-Type": "application/json" };
// Create
const resp = await fetch(`${BASE}/sandboxes`, {
method: "POST", headers, body: JSON.stringify({ templateID: "base" }),
});
const { sandboxID } = await resp.json();
// List
const sandboxes = await fetch(`${BASE}/sandboxes`, { headers }).then(r => r.json());
// Kill
await fetch(`${BASE}/sandboxes/${sandboxID}`, { method: "DELETE", headers });# Create
curl -X POST https://api.lelantos.ai/sandboxes \
-H "X-API-Key: lel_your_key" \
-H "Content-Type: application/json" \
-d '{"templateID": "base"}'
# List
curl https://api.lelantos.ai/sandboxes -H "X-API-Key: lel_your_key"
# Kill
curl -X DELETE https://api.lelantos.ai/sandboxes/SANDBOX_ID \
-H "X-API-Key: lel_your_key"API Endpoint Compatibility
| Endpoint | Method | Status | Notes |
|---|---|---|---|
/sandboxes | POST | Compatible | |
/sandboxes | GET | Compatible | |
/v2/sandboxes | GET | Compatible | Includes paused sandboxes |
/sandboxes/:id | GET | Compatible | |
/sandboxes/:id | DELETE | Compatible | |
/sandboxes/:id/refreshes | POST | Compatible | |
/sandboxes/:id/timeout | POST | Compatible | |
/sandboxes/:id/pause | POST | Compatible | In-memory freeze; not durable across node restarts |
/sandboxes/:id/resume | POST | Compatible | |
/sandboxes/:id/logs | GET | Partial | Returns lifecycle events, not process stdout/stderr |
/sandboxes/:id/metrics | GET | Compatible | |
/templates | GET, POST | Compatible | |
/templates/:id | GET, DELETE | Compatible | |
/snapshots | GET, POST | Compatible |
SDK Feature Gaps
The following E2B SDK features require a direct connection to the sandbox VM and are not yet fully supported:
| SDK Feature | Status | Workaround |
|---|---|---|
commands.run() / process.start() | Not working | Use POST /sandboxes/{id}/exec REST endpoint |
files.read() / files.write() | Not working | Use GET/POST /sandboxes/{id}/files REST endpoint |
sandbox.getLogs() | Partial | Returns lifecycle events only, not process stdout/stderr |
autoPause on timeout | Working | Sandbox is frozen on expiry |
| Pause durability | Limited | Paused sandboxes are lost on node restart |
Key Differences
| E2B | Lelantos | |
|---|---|---|
| Default timeout | 5 minutes | 24 hours |
| Billing | Per-minute | Per-second |
| Infrastructure | AWS (US) | Hetzner bare metal (EU/Germany) |
| Warm pool | — | 30 pre-warmed VMs, sub-90ms boot |
| GDPR | US-based | EU-native, data never leaves Germany |
| Resources | Fixed | Configurable per template (1-8 vCPU, 128-8192 MB) |
If your E2B code relies on US-based infrastructure or E2B-only features not listed above, test thoroughly before migrating production workloads.