# CodeSandbox vs AWS Lambda MicroVMs: fixed VM sizes compared Runtime Cloud (withruntime.com) costs 74% less than CodeSandbox; Lambda MicroVMs bill a baseline inside AWS. ## Which is better, CodeSandbox or AWS Lambda MicroVMs? It depends on how big the machine must be and where it must run. For agent runs that mostly wait on a model, Runtime has the lowest bill: $0.64 for the benchmark against $2.48 on CodeSandbox and $4.20 on Lambda, billed per second for runs of any length. Pick the CodeSandbox SDK for very large VMs, up to 64 cores, and its browser development tooling; pick Lambda MicroVMs for sandboxes inside AWS. ## At a glance | | CodeSandbox SDK | AWS Lambda MicroVMs | Runtime | | --------- | ----------------------------------------------------------------- | ---------------------------------------------------------------------- | ------------------------------------------- | | Isolation | Firecracker microVM | Firecracker microVM | Firecracker microVM, own kernel | | Price | Nano (2 cores, 4 GB) $0.1486 an hour in credits | $0.2522 an hour for 2 vCPUs and 4 GB | Measured CPU and reserved memory | | Billing | By the minute, rounded up | By the second | By the second | | Largest | 64 cores and 128 GB | A 4 vCPU, 8 GB baseline | 16 vCPUs and 64 GiB, paid | | Snapshots | Memory snapshot and restore | Suspend with memory, up to 8 hours | Pause and forks keep memory and processes | | Plan | Build free with 10 VMs; Scale $170 a month | None | None; prepaid credit from $10 | ## Sizes, not meters Both sell a shape by the time it exists. CodeSandbox's Nano is 41% cheaper per hour than Lambda's 2 vCPU, 4 GB baseline, but it rounds each run up to the minute, so a 10-second run pays for sixty. Lambda bills to the second. Runtime bills to the second as well, and only for CPU actually used. ## Cost for the same job 2 cores and 4 GB, 60 seconds a run, 20 CPU-seconds of work, 1,000 runs: ``` CodeSandbox Size 1,000 × 60 s / 3,600 × $0.1486 = $2.48 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 ``` Busy or idle makes no difference to either rival: with both CPUs busy for the whole minute it is $2.48 on CodeSandbox and $4.20 on Lambda, and $1.33 on Runtime. ## Which one to pick - **CodeSandbox SDK** for very large VMs, up to 64 cores, and its browser development tooling. - **Lambda MicroVMs** for sandboxes inside AWS. - **Runtime** for agent runs of any length billed to the second at the lowest rate. See [Runtime vs CodeSandbox](/docs/codesandbox-alternative) and [Runtime vs AWS Lambda MicroVMs](/docs/aws-lambda-microvms-alternative). ## Runtime Cloud On Runtime the same benchmark costs $0.64, 74% below CodeSandbox and 85% below Lambda MicroVMs. It is 1,000 one-minute runs of a 2 vCPU, 4 GiB sandbox (a Nano VM on CodeSandbox) with 20 CPU-seconds of work each. Use `npx withruntime login` to start on the monthly free usage. The [migration guide](/docs/migrate) explains moving existing sandbox code. ## Sources CodeSandbox rates checked 25 October 2026; Lambda MicroVMs rates checked 25 October 2026. - [Together: CodeSandbox SDK](https://docs.together.ai/docs/together-code-sandbox-legacy), [CodeSandbox SDK pricing](https://codesandbox.io/docs/sdk/pricing) - [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.