E2B Pricing Model
E2B bills per second of sandbox compute. You create a sandbox, it starts running, and every second counts toward your usage. The clock does not distinguish between active execution and idle time. If the sandbox exists, you are paying for it.
Each sandbox runs as an isolated microVM (based on Firecracker). You get a full Linux environment with filesystem, networking, and process isolation. The base compute unit is a single vCPU with 512MB RAM, and you can scale up to larger configurations.
The per-second model works well for short-lived sandboxes. Spin up a sandbox, run a code snippet for 3 seconds, tear it down. You pay for 3 seconds. The problem appears when sandboxes stay alive longer than expected, waiting for user input, polling for results, or sitting idle between requests.
E2B Free Tier and Limits
The Hobby tier includes 100 sandbox hours per month at no cost. No credit card required. This is real compute time, not a trial period.
| Feature | Included |
|---|---|
| Sandbox hours | 100 hours/month |
| Concurrent sandboxes | Up to 5 |
| Sandbox duration limit | 1 hour max per sandbox |
| vCPU per sandbox | 1 vCPU |
| RAM per sandbox | 512MB |
| Persistent storage | No |
| Support | Community (Discord) |
| Overage handling | Sandbox creation paused |
100 hours translates to roughly 120,000 sandbox invocations at 3 seconds each, or 6,000 invocations at 60 seconds each. For prototyping, demo apps, and low-traffic tools, the free tier is generous. The 1-hour max sandbox duration and 5 concurrent sandbox limit are the main constraints.
When the Free Tier Runs Out
E2B does not auto-upgrade you to a paid plan. When you hit 100 hours, new sandbox creation fails until the next month. There is no overage billing on the free tier. This is good for budget safety but means your application stops working mid-month if usage spikes.
E2B Pro and Teams Pricing
The Pro plan costs $150/month and includes 500 sandbox hours. Beyond that, you pay per-second overages. The Teams plan adds collaboration features and higher concurrency limits.
| Feature | Hobby (Free) | Pro ($150/mo) | Enterprise (Custom) |
|---|---|---|---|
| Sandbox hours/month | 100 | 500 | Custom (volume pricing) |
| Concurrent sandboxes | 5 | 20 | Custom |
| Max sandbox duration | 1 hour | 24 hours | Custom |
| vCPU options | 1 | Up to 8 | Custom |
| RAM options | 512MB | Up to 8GB | Custom |
| Persistent storage | No | Yes (snapshots) | Yes (dedicated) |
| Custom sandbox templates | Limited | Unlimited | Unlimited + dedicated |
| Support | Community | Email + priority Discord | Dedicated + SLA |
| Overage rate | N/A (paused) | ~$0.000083/sec ($0.30/hr) | Negotiated |
At $150/month for 500 hours, the effective rate is $0.30/hour. That is competitive for managed sandbox infrastructure. But the real cost depends on how efficiently you use those hours. If your average sandbox lives for 60 seconds but does useful work for only 5 seconds, your effective cost per unit of work is 12x the headline rate.
Cost Comparison: E2B vs Alternatives
E2B competes with Modal for serverless compute, Morph for AI code operations, and self-hosted Firecracker/gVisor setups for teams with infrastructure capacity.
| Factor | E2B | Modal | Morph | Self-Hosted |
|---|---|---|---|---|
| Free tier | 100 hrs/mo | ~$30 credits/mo | Free tier available | N/A (infra cost) |
| Paid starting price | $150/mo | Pay-per-use | $20/mo | ~$50-200/mo (server) |
| Billing unit | Per second (CPU) | Per second (CPU/GPU) | Per request/token | Fixed monthly |
| Cold start | 300-800ms | ~200ms (warm) | N/A | 0ms (always running) |
| Idle billing | Yes (always) | No (scale to zero) | No | Yes (fixed cost) |
| GPU support | No | Yes (A100, H100) | No | Depends on hardware |
| Use case | Code execution sandbox | General compute/ML | Code apply/edit | Full control |
| Managed infra | Yes | Yes | Yes | No (you manage) |
| Cost at 1,000 hrs/mo | ~$300 | ~$150-400 | N/A | ~$100-200 |
The comparison is not apples-to-apples. E2B provides sandboxed code execution environments. Modal provides serverless compute with GPU access. Morph provides fast code application (applying AI-generated edits to codebases at 10,500 tok/s). Self-hosted gives you full control at the cost of managing infrastructure.
If your workload is "execute untrusted code in isolation," E2B and self-hosted Firecracker are the direct competitors. If your workload is "apply AI-generated code changes to files," Morph handles that without spinning up a sandbox at all.
When E2B Is Cost-Effective
Prototyping and Development
100 free hours covers most development workflows. If you are building an AI code execution feature and want to validate the approach before committing to infrastructure, E2B's free tier lets you test without financial risk.
Low-Volume Production
Applications with under 500 sandbox hours/month fit comfortably within the Pro plan. At $150/month with predictable usage, the managed infrastructure and zero ops overhead is worth the premium over self-hosting.
Short-Lived Sandboxes
If your sandboxes live for under 10 seconds (run code, return result, destroy), the per-second model is efficient. Cold start overhead is amortized well, and idle time waste is minimal. Code evaluation, test execution, and linting are good fits.
Security-Critical Workloads
Running user-submitted or LLM-generated code in production requires strong isolation. E2B's Firecracker-based microVMs provide hardware-level isolation without you building the sandboxing layer. The cost premium over bare compute buys real security.
When Alternatives Save Money
Scale (2,000+ Hours/Month)
Above 2,000 sandbox hours/month, self-hosted Firecracker on a dedicated server costs $100-200/month versus $600+ on E2B. The infrastructure management overhead is justified by 3-6x cost savings. Modal's scale-to-zero model also becomes cheaper for bursty workloads at this volume.
Predictable, Steady Workloads
If your sandbox usage is consistent (not bursty), reserved compute on AWS or GCP is 40-60% cheaper than E2B's per-second pricing. Per-second billing rewards burstiness. Steady-state workloads pay a premium for flexibility they do not use.
Code Application (Not Execution)
If your AI workflow generates code edits that need to be applied to existing files, you do not need a sandbox. Morph's apply model takes a diff and a file, produces the edited file at 10,500 tok/s, and costs a fraction of spinning up a sandbox. Different tool for a different problem.
Long-Running Interactive Sessions
AI agents that maintain sandbox state across multiple conversation turns pay for all the idle time between turns. Modal's scale-to-zero or a persistent server with container pooling eliminates idle billing entirely.
Frequently Asked Questions
How much does E2B cost?
E2B has three tiers. The Hobby tier is free with 100 sandbox hours/month. The Pro tier costs $150/month and includes 500 hours with per-second overages beyond that. Enterprise pricing is custom and negotiated directly with E2B's sales team, typically starting in the low thousands per month for dedicated infrastructure and SLAs.
Does E2B have a free tier?
Yes. 100 sandbox hours per month, no credit card required. You get up to 5 concurrent sandboxes, each limited to 1 hour of runtime. When you hit the 100-hour cap, new sandbox creation is paused until the next billing cycle. There is no automatic upgrade to a paid plan.
What are E2B's hidden costs?
The main ones: cold start time (300-800ms billed per sandbox), idle time (the meter runs whether code is executing or waiting), snapshot storage for persistent sandbox state, and network egress on high-bandwidth workloads. For interactive AI applications, idle time between user turns is the biggest hidden cost. Only 15-30% of billed time may be productive compute.
Is E2B cheaper than Modal?
For workloads under 100 hours/month, E2B's free tier wins. For GPU workloads, Modal is the only option (E2B does not offer GPU sandboxes). For CPU workloads at scale, Modal's scale-to-zero billing means you do not pay for idle time, which can make it 30-50% cheaper for bursty, interactive workloads. E2B's advantage is purpose-built code execution sandboxing with strong isolation.
Can I self-host E2B?
E2B open-sourced their sandbox runtime. You can run the execution layer on your own infrastructure. You lose managed orchestration, auto-scaling, the snapshot system, and the SDK's managed lifecycle. Self-hosting makes economic sense above roughly 2,000 sandbox hours/month, where the $600+ E2B bill exceeds the $100-200 cost of a dedicated server plus engineering time.
How does E2B billing work?
Per second of sandbox uptime. The clock starts at sandbox creation (including boot time) and stops at destruction. There is no distinction between active compute and idle waiting. Pre-warmed sandbox pools on Pro plans reduce cold start latency but the pool maintenance itself counts toward your hours.
What is E2B enterprise pricing?
Custom, negotiated with E2B's sales team. Enterprise plans include dedicated infrastructure, uptime SLAs, priority support, custom sandbox configurations (larger VMs, longer durations), and volume discounts on compute hours. Most enterprise contracts are in the $2,000-10,000/month range depending on volume.
How does Morph compare to E2B for AI code execution?
They solve different problems. E2B executes arbitrary code in isolated sandboxes. Morph applies AI-generated code edits to existing files at 10,500 tokens/second. If your AI agent generates a diff and you need it applied to a codebase, Morph handles that without sandbox overhead. If your AI agent generates code that needs to run (tests, scripts, data processing), E2B provides the isolated execution environment. Many AI coding workflows use both: Morph for applying edits, E2B for running tests.
Skip the Sandbox for Code Edits
Morph applies AI-generated code changes at 10,500 tok/s without spinning up a sandbox. If your workflow is edit-apply-commit, not execute-in-isolation, try Morph.