E2B Pricing Breakdown: Per-Second Billing and Hidden Costs (2026)

E2B charges per second of sandbox compute. Free tier gives you 100 hours/month. Pro is $150/month. But cold starts, idle time, and storage add up fast at scale. Full pricing breakdown with comparisons to Morph, Modal, and self-hosted alternatives.

April 4, 2026 · 1 min read

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.

$0
Free tier (100 hrs/mo)
$150
Pro plan (500 hrs/mo)
Custom
Enterprise (volume discounts)

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.

FeatureIncluded
Sandbox hours100 hours/month
Concurrent sandboxesUp to 5
Sandbox duration limit1 hour max per sandbox
vCPU per sandbox1 vCPU
RAM per sandbox512MB
Persistent storageNo
SupportCommunity (Discord)
Overage handlingSandbox 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.

FeatureHobby (Free)Pro ($150/mo)Enterprise (Custom)
Sandbox hours/month100500Custom (volume pricing)
Concurrent sandboxes520Custom
Max sandbox duration1 hour24 hoursCustom
vCPU options1Up to 8Custom
RAM options512MBUp to 8GBCustom
Persistent storageNoYes (snapshots)Yes (dedicated)
Custom sandbox templatesLimitedUnlimitedUnlimited + dedicated
SupportCommunityEmail + priority DiscordDedicated + SLA
Overage rateN/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.

Hidden Costs

Per-second billing sounds transparent. In practice, several factors inflate your bill beyond what you would expect from raw execution time.

Cold Start Time

Sandbox boot takes 300-800ms depending on template complexity. You pay for this time even though no user code is running. For short-lived sandboxes (under 5 seconds), cold start can represent 10-15% of your bill. E2B offers pre-warmed pools on Pro plans to reduce this, but pool maintenance itself counts toward your hours.

Idle Time

The billing clock runs whether your sandbox is executing code or waiting. An AI agent that creates a sandbox, runs code for 2 seconds, then waits 30 seconds for user confirmation before running more code pays for all 32 seconds. There is no pause/resume mechanism to stop billing during idle periods.

Storage and Snapshots

Sandbox snapshots let you save and restore sandbox state. This is useful for caching dependency installs and pre-configured environments. But snapshot storage is billed separately, and restoring from a snapshot still incurs boot time. Large snapshots (1GB+) with installed dependencies add measurable restore latency.

Network Egress

Sandboxes that pull large packages (npm install, pip install) or transfer data out consume network bandwidth. E2B includes reasonable bandwidth in the plan price, but high-throughput workloads (large file processing, dataset downloads) can trigger additional charges on enterprise plans.

The Idle Time Problem

Interactive AI applications are the worst case for per-second billing. A chatbot that creates a sandbox per conversation turn, with 10 seconds of code execution and 45 seconds of the user thinking, pays for 55 seconds per turn. Only 18% of that is productive compute. Multiply across thousands of users and the waste adds up.

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.

FactorE2BModalMorphSelf-Hosted
Free tier100 hrs/mo~$30 credits/moFree tier availableN/A (infra cost)
Paid starting price$150/moPay-per-use$20/mo~$50-200/mo (server)
Billing unitPer second (CPU)Per second (CPU/GPU)Per request/tokenFixed monthly
Cold start300-800ms~200ms (warm)N/A0ms (always running)
Idle billingYes (always)No (scale to zero)NoYes (fixed cost)
GPU supportNoYes (A100, H100)NoDepends on hardware
Use caseCode execution sandboxGeneral compute/MLCode apply/editFull control
Managed infraYesYesYesNo (you manage)
Cost at 1,000 hrs/mo~$300~$150-400N/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.