# E2B vs AWS Lambda MicroVMs: pricing, sessions and limits Runtime Cloud (withruntime.com) costs 77% less than E2B, which in turn costs less than Lambda MicroVMs. ## Which is better, E2B or AWS Lambda MicroVMs? It depends on where the rest of your stack lives. For agents that wait on a model, Runtime is the cheapest of the three Firecracker options: $0.64 for this job, against $2.76 on E2B and $4.20 on Lambda, and still the lowest with both CPUs busy. Pick E2B to self-host later under Apache-2.0 or to keep paused sandboxes with no expiry. Pick Lambda MicroVMs if everything else is on AWS and you want IAM, VPC access and many regions. ## At a glance | | E2B | AWS Lambda MicroVMs | Runtime | | ---------- | ----------------------------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------- | | Isolation | Firecracker microVM, own kernel | Firecracker microVM | Firecracker microVM, own kernel | | CPU | $0.0504 per allocated vCPU-hour | $0.0997 per baseline vCPU-hour, billed by second | $0.025 per vCPU-hour of measured CPU, with a small floor | | Memory | $0.0162 per GiB-hour | $0.0132 per GB-hour, 2 GB per vCPU | $0.0075 per reserved GiB-hour | | Largest | 8 vCPUs and 8 GiB | 4 vCPUs and 8 GB at peak | 16 vCPUs and 64 GiB, paid | | Session | 1 hour on Hobby, 24 hours on Pro | State kept up to 8 hours | No time limit: runs while it works, or `persistent` | | Idle | Pause keeps memory, with no expiry | Suspends into a snapshot after an idle time you set | Pause keeps memory while you have credit | | Free start | $100 of usage credit, once | No free tier for MicroVMs | 100 free hours of a 1 GB machine in the first 30 days, no card | ## Why is Lambda dearer than E2B here? Lambda's memory rate is a little lower per unit, but its CPU is about twice E2B's: $0.0997 per vCPU-hour against $0.0504. For a 2 vCPU sandbox that is $0.199 an hour of CPU on Lambda and $0.101 on E2B, whatever the code does. Neither discounts a vCPU for sitting idle while the agent waits on its model. Runtime does: waiting costs a floor of a twentieth of a vCPU. ## Cost for the same job 1,000 runs, 60 seconds each, 20 CPU-seconds of work, 2 vCPU and 4 GiB (a 4 GB baseline on Lambda): ``` E2B 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 Lambda CPU 1,000 × 60 s × 2 × $0.0000276944 = $3.32 Memory 1,000 × 60 s × 4 × $0.0000036667 = $0.88 Total $4.20 Runtime 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.64 ``` At 100,000 runs a month that is $276.00 on E2B, $420.33 on Lambda MicroVMs and $63.89 on Runtime. If the agent kept both CPUs busy for the whole minute, the job would cost $1.33 on Runtime, still the lowest, with $2.76 on E2B and $4.20 on Lambda unchanged, since both already bill every vCPU as if it worked. ## Sessions: one hour, eight hours, or as long as you like E2B's free Hobby plan caps a session at an hour; Pro at $150 a month lifts it to 24 hours. A Lambda MicroVM keeps its memory and disk for up to eight hours, and suspends after an idle time you set, when compute stops and snapshot storage starts at $0.08 per GB-month. A Runtime sandbox has no time limit: it runs while it works, `persistent: true` keeps a paid one running even while idle, and a pause keeps its memory for as many days as you set, up to 365. ## Which one to pick - **E2B** if you want to self-host later (its runtime is Apache-2.0) or keep paused sandboxes with no expiry. - **Lambda MicroVMs** if everything else is already on AWS: IAM, VPC access through a network connector, and many regions. - **Runtime** for agents that wait on models: the lowest bill of the three at any level of use, sandboxes up to 16 vCPUs and 64 GiB, and forks that copy a running machine. `withruntime/e2b` runs E2B code by changing one import. See [Runtime vs E2B](/docs/e2b-alternative) and [Runtime vs AWS Lambda MicroVMs](/docs/aws-lambda-microvms-alternative). ## Runtime Cloud Runtime runs the same job for 77% less than E2B and 85% less than Lambda MicroVMs. 1,000 one-minute runs of a 2 vCPU, 4 GiB sandbox cost $2.76 on E2B, $4.20 on AWS Lambda MicroVMs and $0.64 on Runtime. All three use Firecracker; only Runtime bills the CPU the code used instead of every vCPU it holds. Sign in with `npx withruntime login` and run the job on the free usage. E2B code switches with one import line, as the [migration guide](/docs/migrate) explains. ## Sources E2B rates checked 25 October 2026; Lambda rates checked 25 October 2026. - [E2B pricing](https://e2b.dev/pricing), [E2B sandbox persistence](https://docs.e2b.dev/sandbox/persistence) - [AWS Lambda pricing](https://aws.amazon.com/lambda/pricing/), [Lambda MicroVMs](https://aws.amazon.com/lambda/lambda-microvms/) - Runtime [pricing](/docs/pricing) Facts on this page were checked on 26 October 2026.