Skip to content
Home

Migrate from E2B

SeaCloud Sandbox keeps familiar sandbox concepts while exposing SeaCloud-specific gateway auth, template references, runtime tokens, and public port URLs.

RuntimeE2B packageSeaCloud package
Node@e2b/code-interpreter or e2b@seacloudai/sandbox
Pythone2b-code-interpreter or e2bseacloud-sandbox
GoE2B client packagegithub.com/SeaCloudAI/sandbox-go
PurposeE2BSeaCloud
API tokenE2B_API_KEYSEACLOUD_API_KEY
API hostUsually SDK defaultSEACLOUD_BASE_URL=https://sandbox-service.real-cloud.seaart.ai/api/v1/sandbox
Runtime tokenHidden by SDKenvdAccessToken, hidden by SDK after create/connect
E2B conceptSeaCloud equivalentNotes
Sandbox.create() / new Sandbox()Sandbox.create(options) or Sandbox.create(templateID, options)SeaCloud defaults to base when no template is provided. Pass code-interpreter or a concrete tpl-... when you need a specific environment.
Sandbox.connect(id)Sandbox.connect(id, options)Reconnect refreshes runtime URL/token from the control plane.
sandbox.kill() / sandbox.close()sandbox.delete()Delete disposable sandboxes. Use pause() when you intend to reconnect.
sandbox.setTimeout(...)sandbox.setTimeout(seconds)Lifecycle timeout is seconds.
Commandssandbox.commands.run(cmd, options)Runtime command timeout is timeoutMs in milliseconds.
Filesystemsandbox.files.read/write/list/makeDirPaths should be absolute in production examples.
Host URLsandbox.getHost(port)Returns a proxy URL derived from envdUrl; the raw port route is https://sandbox-router.cloud.seaart.ai/{port}-{sandboxID}/.
Code interpretersandbox.runCode(...) / run_code(...)Use the code-interpreter template.
// Before: E2B-style
// const sandbox = await Sandbox.create();
// const result = await sandbox.commands.run("echo hello");
// await sandbox.kill();
// After: SeaCloud. Omitting the template uses base.
import { Sandbox } from "@seacloudai/sandbox";
const sandbox = await Sandbox.create({
timeout: 1800,
waitReady: true,
});
try {
const result = await sandbox.commands.run("sh", {
args: ["-lc", "echo hello"],
timeoutMs: 30_000,
});
console.log(result.stdout);
} finally {
await sandbox.delete();
}
  1. Replace packages and environment variables.
  2. Use the default base template for basic commands/files, or pass code-interpreter for runCode and concrete tpl-... IDs for production.
  3. Replace kill/close calls with delete() for disposable work or pause() for resumable work.
  4. Review timeout units: sandbox lifecycle timeout is seconds; command timeoutMs is milliseconds.
  5. Replace hand-built app URLs with getHost(port) when using SDKs.
  6. Keep envdAccessToken out of logs and client-side code.