# E2B vs Vercel Sandbox

URL: https://heaven.dev/compare/e2b-vs-vercel-sandbox
Title: E2B vs Vercel Sandbox - running your users' code from your app
Description: E2B and Vercel Sandbox for an app that runs user or agent code: busy-CPU or allocated billing, pause or saved files, limits and a month of runs.
Checked: November 21, 2026

E2B and Vercel Sandbox both give your app a microVM per task, started from a TypeScript or Python SDK, with runs of up to 24 hours on their paid plans. Pick E2B when a sandbox should come back exactly as it was: a pause keeps memory and processes with no expiry, a fork copies it mid-run, and its Code Interpreter SDK returns charts, with commercial use allowed on the free plan. Pick Vercel Sandbox when tasks spend most of their time waiting on a model, or your app already runs on Vercel: it bills CPU only while it's busy, saves a sandbox's files between sessions and runs in 19 regions.

## E2B vs Vercel Sandbox features

| Running time and state | E2B | Vercel Sandbox |
| --- | --- | --- |
| **Longest uninterrupted run** | 1 hour on Hobby, 24 hours on Pro. Resuming starts the clock again | 5 minutes by default. 45 minutes on Hobby, 24 hours on Pro |
| **When a run ends** | Deleted, unless auto-pause keeps it, with no expiry | Files are saved. The next session boots a fresh VM and processes start again |
| **Freeze it with memory and processes** | ✓ Pause, resumed in about 1 second | ✗ Snapshots keep files, not memory |
| **Wakes when a request arrives** | ✓ Opt-in auto-resume | Your code resumes it with an SDK call |
| **Branch a running sandbox** | ✓ Fork with memory, up to 20 copies a call | ✓ Fork from its latest saved files |
| **Files that outlive any sandbox** | Volumes in private beta | ✓ Drives, mounted into any session |
| **How long saved state is kept** | Paused sandboxes have no expiry | Snapshots 30 days after last use by default, or forever |

| Cost and limits | E2B | Vercel Sandbox |
| --- | --- | --- |
| **CPU** | $0.0504 a vCPU-hour for every running second | $0.128 an hour, only while the CPU is busy |
| **Memory** | $0.0162 a GiB-hour | $0.0212 a GB-hour, with a one-minute minimum |
| **Free usage** | $100 once, commercial use allowed | Hobby quotas, for non-commercial use only. Pro includes $20 a month |
| **Paid plan** | Pro, $150 a month: custom sizes, 24-hour runs | Pro, $20 a month per team plus $20 per extra deploying seat |
| **Sizes** | 2 vCPUs and 512 MiB on Hobby. Up to 8 vCPUs and 8 GiB on Pro | Up to 4 vCPUs on Hobby, 8 on Pro, 32 on Enterprise, at 2 GB per vCPU |
| **Sandboxes at once** | 10 on Hobby, 100 on Pro, up to 1,100 with add-ons | 10 on Hobby, 10,000 on Pro |
| **Where it runs** | 5 regions. US West by default, the rest on request | 19 regions, with failover on Pro |

| Building and networking | E2B | Vercel Sandbox |
| --- | --- | --- |
| **Coding agents ready to run** | ACP builds an agent template, starts the agent and streams its session | ✓ Claude Code, Codex, OpenCode and Pi in the default image |
| **Computer-use agents** | ✓ Desktop template with screenshot and input APIs | Install Vercel's screen-relay example |
| **Who can open a preview** | Private on new projects behind a token or signed URL, or public | ✗ Anyone with the port's URL |
| **Outbound rules for untrusted code** | ✓ IP, CIDR and hostname | ✓ Domain and CIDR, down to HTTP method, path and headers |
| **Fixed outbound address** | Through a proxy you run | Enterprise, through Secure Compute |

Both have TypeScript and Python SDKs, a CLI and an HTTP API, root and Docker inside, your own images, credentials added to outbound requests outside the sandbox, and SOC 2.

## Who should pick E2B

E2B fits an app whose sandboxes carry state a user or an agent will come back to.

- **Pause that keeps everything.** A full pause keeps files, memory and running processes with no expiry and resumes in about a second, and auto-resume wakes a paused sandbox when a request reaches it. On Vercel a resumed session is a fresh VM with the saved files.

- **Branching from a running state.** One fork call copies a running sandbox, memory included, into up to 20 new ones.

- **Parts built for AI products.** The Code Interpreter SDK keeps variables between calls and returns charts and tables as data, the Desktop template gives computer-use agents screenshot and input APIs, and previews can be private.

- **Commercial use for $0 a month.** Hobby allows a product to run on it, with $100 of credit to start, and E2B Embed is an open-source version you can run yourself.

It isn't the fit for runs over an hour or above the default size without Pro at $150 a month.

## Who should pick Vercel Sandbox

Vercel Sandbox fits an app that runs many short tasks which mostly wait, especially one already on Vercel.

- **Pay for busy CPU.** Active CPU is billed only while the CPU works, so a task waiting on a model pays mostly for memory, plus $0.60 per million starts. Pro is $20 a month with $20 of usage included, and runs 10,000 sandboxes at once.

- **Files that come back.** A named sandbox saves its filesystem when it stops and loads it on the next SDK call, and Drives keep data apart from any one sandbox.

- **Network rules that see requests.** The firewall can match HTTP method, path and headers on allowed domains, and adds credentials to them without the code seeing them.

- **Regions and agents included.** Sandboxes run in 19 regions with failover on Pro, and the default image comes with Claude Code, Codex, OpenCode and Pi.

It isn't the fit for a private preview, since an exposed port is open to anyone with its URL, or for keeping a process's memory between sessions. A commercial product also needs Pro, because Hobby is for personal use.

## Pricing

| Plan | Price | What you get |
| --- | --- | --- |
| **E2B Hobby** | $0 plus usage, $100 of credit once | The default 2 vCPU, 512 MiB sandbox, 10 at once, runs up to 1 hour |
| **E2B Pro** | $150 a month plus usage | Sizes up to 8 vCPUs and 8 GiB, 100 at once, runs up to 24 hours |
| **Vercel Hobby** | $0, non-commercial use only | 5 hours of busy CPU, 420 GB-hours of memory, 10 sandboxes, 45-minute sessions |
| **Vercel Pro** | $20 a month per team, $20 per extra deploying seat | $20 of usage a month, 10,000 sandboxes, 24-hour sessions |

The work: an app runs 1,000 user tasks a month, each 6 minutes long, with the CPU busy for 2 of them while it waits on a model. Each needs 1 vCPU and under 512 MiB. That's 100 hours of sandbox time and about 33 hours of busy CPU. A commercial product rules out Vercel Hobby.

- **E2B Hobby:** 100 hours at the default 2 vCPUs and 512 MiB, $0.1089 an hour, is **$10.89**. The $100 credit covers it for the first nine months.

- **Vercel Pro:** $4.27 of busy CPU plus $4.24 for 2 GB of memory over 100 hours is $8.51 of usage. The $20 credit covers it, so the bill is **$20**, and the team's other Vercel usage draws on the same credit.

E2B passes Vercel's $20 above about 184 hours of sandbox time. At 400 hours with the same mix, E2B costs $43.56 and Vercel $34.03. If the CPU stays busy instead of waiting, E2B costs less at any volume.

## Frequently asked questions

### Can Vercel Sandbox keep variables in memory between sessions?

No. Each session boots a fresh VM from the saved files, so write what you need to disk. E2B keeps memory through a pause.

### Which is cheaper for runs that wait on a model?

Vercel, at volume, because it bills CPU only while it's busy. A waiting E2B sandbox bills its whole allocation unless your app pauses it.

### Can I use Vercel Hobby for a commercial product?

No. Hobby is for personal and non-commercial use, so a product needs Pro. E2B Hobby allows commercial use.

## Also consider Heaven

Heaven, which we make, is cloud infrastructure for software factories. Each agent or app gets a Computer: a full Linux VM with root that keeps running with nobody connected, and a team's Computers share one pool of CPU, memory and storage. Every Computer comes with an HTTPS website with sign-in in front, share links, custom domains, public TCP ports, email, snapshots and hourly off-site backups, and integrations keep GitHub and API credentials outside the machine. Plans start at $20 a month for 2 vCPUs and 8 GiB, with any number of members. See [pricing](https://heaven.dev/pricing).

## Related comparisons

See [E2B alternatives](https://heaven.dev/alternatives/e2b), [E2B vs Modal Sandboxes](https://heaven.dev/compare/e2b-vs-modal), [E2B vs Daytona](https://heaven.dev/compare/e2b-vs-daytona) and [the best code sandboxes for AI agents](https://heaven.dev/compare/best-code-sandboxes-for-ai-agents).

## Sources and corrections

| Source | Checked |
| --- | --- |
| [E2B pricing](https://e2b.dev/pricing) | November 20, 2026 |
| [E2B plans and limits](https://docs.e2b.dev/billing#plans) | November 19, 2026 |
| [E2B auto-pause and persistence](https://docs.e2b.dev/sandbox/persistence.md) | November 19, 2026 |
| [E2B auto-resume](https://docs.e2b.dev/sandbox/auto-resume.md) | November 19, 2026 |
| [E2B fork](https://docs.e2b.dev/sandbox/fork#create-multiple-forks) | November 20, 2026 |
| [E2B volumes](https://docs.e2b.dev/volumes.md) | November 19, 2026 |
| [E2B interpreter contexts](https://docs.e2b.dev/code-interpreting/contexts.md) | November 19, 2026 |
| [E2B ACP](https://docs.e2b.dev/agents/acp.md) | November 19, 2026 |
| [E2B computer use](https://docs.e2b.dev/use-cases/computer-use.md) | November 19, 2026 |
| [E2B ingress access](https://docs.e2b.dev/network/restrict-public-access.md) | November 19, 2026 |
| [E2B internet access rules](https://docs.e2b.dev/network/internet-access) | November 19, 2026 |
| [E2B static egress through a proxy](https://docs.e2b.dev/network/ip-tunneling.md) | November 19, 2026 |
| [E2B regions](https://docs.e2b.dev/faq/egress-ip-ranges.md) | November 19, 2026 |
| [E2B BYOC](https://docs.e2b.dev/byoc) | November 19, 2026 |
| [E2B Embed](https://github.com/e2b-dev/runtime/tree/main/embed) | November 19, 2026 |
| [Vercel Sandbox](https://vercel.com/docs/sandbox) | November 19, 2026 |
| [Vercel Sandbox pricing and limits](https://vercel.com/docs/sandbox/pricing) | November 20, 2026 |
| [Vercel persistent Sandboxes](https://vercel.com/docs/sandbox/concepts/persistent-sandboxes) | November 19, 2026 |
| [Vercel Sandbox snapshots](https://vercel.com/docs/sandbox/concepts/snapshots) | November 19, 2026 |
| [Vercel Sandbox fork](https://vercel.com/docs/sandbox/sdk-reference#sandbox.fork) | November 19, 2026 |
| [Vercel Drives](https://vercel.com/docs/sandbox/concepts/drives) | November 19, 2026 |
| [Vercel universal image](https://github.com/vercel/sandbox/blob/main/images/universal/Dockerfile) | November 19, 2026 |
| [Vercel desktop streaming](https://vercel.com/docs/sandbox/examples/desktop-streaming) | November 19, 2026 |
| [Vercel exposed ports](https://vercel.com/docs/sandbox/examples/expose-a-port) | November 19, 2026 |
| [Vercel Sandbox Firewall](https://vercel.com/docs/sandbox/concepts/firewall) | November 19, 2026 |
| [Vercel Secure Compute](https://vercel.com/docs/sandbox/concepts/secure-compute) | November 19, 2026 |
| [Vercel Sandbox regions](https://vercel.com/docs/sandbox/concepts/regions) | November 19, 2026 |
| [Vercel Hobby terms](https://vercel.com/legal/terms#4-hobby-plan) | November 19, 2026 |

Spot an error? Email support@heaven.dev with the page, the claim and a source.
