Quickstart
Get a sandbox running in under 2 minutes.
Upgrading? @lelantos-ai/sdk@0.2.0 adds compute exec, browser sandboxes, and the /rpc client plus the modern createLelantos() namespaced API. The legacy LelantosClient API from earlier versions still works — just npm i @lelantos-ai/sdk@latest.
Install the SDK
npm install @lelantos-ai/sdkShort alias: npm i lelantos re-exports the same package (import … from 'lelantos').
Get an API Key
Sign in to the Lelantos Dashboard and navigate to API Keys. Create a new key — it will start with lel_.
Create a Sandbox
import { LelantosClient } from "@lelantos-ai/sdk";
const client = new LelantosClient({
apiKey: process.env.LELANTOS_API_KEY!,
});
const sandbox = await client.createSandbox({
templateID: "base",
});
console.log("Sandbox ID:", sandbox.sandboxID);
console.log("URL:", sandbox.getURL());Modern namespaced API. The same @lelantos-ai/sdk package also ships the recommended forward-looking style via createLelantos():
import { createLelantos } from "@lelantos-ai/sdk";
const lel = createLelantos({
apiKey: process.env.LELANTOS_API_KEY!,
domain: "lelantos.ai",
});
const sbx = await lel.compute.create("base");
await sbx.runCommand("echo hi");
await sbx.destroy();Both styles ship in @lelantos-ai/sdk — the legacy LelantosClient (shown above) and the modern createLelantos() with lel.compute.* / lel.browser.* / lel.browser.rpc. Pick whichever fits; you can mix them.
Upload & Download Files
// Upload a file
await sandbox.uploadFile("/home/user/hello.txt", "Hello from Lelantos!");
// Download it back
const data = await sandbox.downloadFile("/home/user/hello.txt");
console.log(new TextDecoder().decode(data));Manage Lifecycle
// Extend lifetime by 1 hour
await sandbox.refresh(3600);
// Pause to save resources (resume later)
await sandbox.pause();
// Resume when needed
await sandbox.resume();
// Clean up when done
await sandbox.kill();Lifecycle Events
Retrieve lifecycle events for any sandbox — even after it has been killed.
const events = await sandbox.getLogs();
for (const ev of events.logs) {
console.log(`[${ev.timestamp}] ${ev.line}`);
}
// [2026-03-06T10:00:52Z] sandbox.lifecycle.created
// [2026-03-06T10:00:52Z] sandbox.lifecycle.killedCustom Templates
Build a custom template from a Dockerfile. Set cpuCount (1–8) and memoryMB (128–8192). Defaults: 2 vCPU, 512 MB.
const template = await client.createTemplate({
dockerfile: "FROM python:3.12\nRUN pip install numpy pandas",
alias: "data-science",
cpuCount: 4,
memoryMB: 2048,
});
console.log("Template:", template.templateID);
console.log("Build:", template.buildID);
// Check build status
const status = await client.getTemplateBuildStatus(
template.templateID,
template.buildID,
);
console.log("Status:", status.status); // "building" | "ready" | "error"Use with cURL
All endpoints are documented in the API Reference.
# Create a sandbox
curl -X POST https://api.lelantos.ai/sandboxes \
-H "X-API-Key: lel_your_key_here" \
-H "Content-Type: application/json" \
-d '{"templateID": "base"}'
# List running sandboxes
curl https://api.lelantos.ai/sandboxes \
-H "X-API-Key: lel_your_key_here"
# Kill a sandbox
curl -X DELETE https://api.lelantos.ai/sandboxes/SANDBOX_ID \
-H "X-API-Key: lel_your_key_here"Browser Sandboxes
Lelantos also runs browser sandboxes — a headless chromium or firefox engine you drive over CDP (via Playwright) or through the lightweight NDJSON /rpc action API. Both are exposed through the modern createLelantos() surface.
import { createLelantos } from "@lelantos-ai/sdk";
const lel = createLelantos({
apiKey: process.env.LELANTOS_API_KEY!,
domain: "lelantos.ai",
});
// 1. Playwright over CDP (needs `playwright` installed)
const { browser, artifacts, close } = await lel.browser.createBrowser({
engine: "chromium",
});
// `browser` is a connected Playwright Browser — use it as usual.
await artifacts.screenshot();
await close();
// 2. The NDJSON /rpc action API — no Playwright required
const rpc = await lel.browser.rpc(sandboxId);
await rpc.navigate("https://example.com");
const snap = await rpc.snapshot();
const { value: title } = await rpc.evaluate("document.title");
await rpc.close();Browser sandboxes are stateful (live browser state + fingerprints) — they do not support durable pause/recover. The lifecycle is create → use → close; reconnect to a still-running sandbox with lel.browser.connect(sandboxId). See the Browser Sandboxes API reference for the full surface.
Next Steps
- SDK Reference — full API surface
- Authentication — API key, bearer token, admin token
- E2B Compatibility — migration guide
- API Reference — complete REST API