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-gateway.cloud.seaart.ai
Runtime tokenHidden by SDKenvdAccessToken, hidden by SDK after create/connect
E2B conceptSeaCloud equivalentNotes
Sandbox.create() / new Sandbox()Sandbox.create(templateID, options)SeaCloud requires an explicit template reference such as base, code-interpreter, or tpl-....
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 https://{port}-{sandboxID}.{domain}/.
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
import { Sandbox } from "@seacloudai/sandbox";
const sandbox = await Sandbox.create("base", {
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. Choose an explicit template: base for commands/files, code-interpreter for runCode, or a concrete tpl-....
  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.