DocumentationAccount

Runtime vs E2B

Runtime and E2B both run agent code in Firecracker microVMs; the main difference is that Runtime bills the CPU your code actually uses.

This page compares the two for teams looking for an E2B alternative. Facts about E2B come from its public pricing and documentation, checked 22 September 2026; check the links at the end before relying on them. Equal vCPU counts do not prove equal performance, and the two services have not been benchmarked against each other.

At a glance

Runtime E2B
Isolation Firecracker microVM, own kernel Firecracker microVM, own kernel
CPU billing $0.025 per vCPU-hour of measured CPU, with a small floor $0.0504 per allocated vCPU-hour
Memory billing $0.0075 per reserved GiB-hour $0.0162 per GiB-hour
Plan fee None; prepaid credit from $10 Hobby $0; Pro $150 a month
Free start 20 sandbox hours, no card $100 of usage credit on Hobby
Session length Leases of up to an hour, extended as often as needed 1 hour on Hobby, 24 hours on Pro
Pause and resume Files and memory; paid retention 1–365 days Files and memory; paused sandboxes kept indefinitely
Interfaces API, CLI, MCP server, JavaScript and Python SDKs API, CLI, MCP server, JavaScript and Python SDKs
Agent sign-in Browser approval; no key in the agent's config API key
Regions and GPUs One region; no GPUs See E2B's documentation

Cost for the same job

Take 1,000 runs of a 2 vCPU, 4 GiB sandbox. Each run lasts 60 seconds and keeps the CPU busy for 20 CPU-seconds, which is typical of an agent that spends most of its time waiting for a model.

TextRuntime  CPU    1,000 × 20 s / 3,600 × $0.025      = $0.14         Memory 1,000 × 60 s / 3,600 × 4 × $0.0075 = $0.50         Total                                        $0.64E2B      CPU    1,000 × 60 s / 3,600 × 2 × $0.0504 = $1.68         Memory 1,000 × 60 s / 3,600 × 4 × $0.0162 = $1.08         Total                                        $2.76

E2B bills the vCPUs a sandbox has for as long as it runs. Runtime bills the CPU the sandbox measurably used, with a default floor of a twentieth of a vCPU. The gap narrows as a workload keeps its CPUs busy: with both CPUs busy for the whole minute, the same job costs $1.33 on Runtime and $2.76 on E2B. Plan fees, storage, network, taxes and free credits are excluded from both. See pricing for Runtime's terms.

Where E2B is stronger

  • Track record. E2B has run agent sandboxes in production far longer. Runtime opened public signup in September 2026.
  • Open source. E2B publishes its runtime under Apache-2.0, so you can read and self-host it. Runtime is a hosted service only.
  • Saved state. E2B keeps a paused sandbox indefinitely. Runtime keeps it for the retention you set, up to 365 days. Its saved state stays on one host, and a full host can delay a wake.
  • Snapshots and forks. Runtime's are paused while an issue is fixed; build a custom image to start many sandboxes from one setup.
  • Reach. Runtime runs in one region today and has no GPUs.

Where Runtime is stronger

  • Cost for agents that wait. CPU you do not use is not billed, and there is no monthly plan fee for sessions longer than an hour.
  • Setup by the agent. An agent runs npx withruntime run --trial -- ..., shows you a link, and starts work once you approve it in the browser. No API key is copied into a prompt or a config file, and the MCP server reuses the same connection.
  • Safe retries. Every write takes an idempotency key, and the SDKs retry with one automatically, so a lost response does not create a second sandbox.

Moving from E2B

The calls map one to one for most integrations.

E2B:

JavaScriptimport { Sandbox } from "e2b";const sbx = await Sandbox.create();const result = await sbx.commands.run("python3 -c 'print(6 * 7)'");await sbx.kill();

Runtime:

TypeScriptimport { Sandbox } from "withruntime";const box = await Sandbox.create({ funding: "trial" });try {  console.log((await box.exec("python3 -c 'print(6 * 7)'", { check: true })).stdout);} finally {  await box.stop();}

To have a coding agent make the switch, test it and compare costs on your own workload, give it the prompt in migration. Keep E2B available until the same job passes on both.

Sources

Try for free

Was this page right?