E2B gives an AI agent a real Linux sandbox to run code in — the standard answer to "my model wrote a script, now what executes it". Billing is per second of sandbox lifetime rather than per request, which makes it cheap for short bursts and expensive in exactly one way people keep discovering the hard way.
| Item | Rate | Roughly | Notes |
|---|---|---|---|
| 2 vCPU sandbox (default) | $0.000028 / s | ≈ $0.10 / hour | Wall-clock lifetime, not CPU time |
| RAM | $0.0000045 / GiB / s | ≈ $0.016 / GiB / hour | Added on top of vCPU |
| Storage | $0 | 10 GiB Hobby, 20 GiB Pro | Free within the allowance |
| Pro plan | $150 / month | 24-hour sessions | More concurrency, custom CPU/RAM |
→ Estimate your bill on the API cost calculator or model a whole app with the AI app cost estimator.
Yes, and it is unusually generous. The Hobby plan costs nothing, requires no card, and includes a one-time $100 usage credit, sessions up to one hour, and 20 concurrent sandboxes. At roughly $0.10 an hour per sandbox, $100 of credit is about a thousand sandbox-hours — far more than a prototype needs. See how it compares on the free API tiers page.
1. Sign up at e2b.dev — no card needed for Hobby.
2. Open the dashboard and copy your API key.
3. Export it as E2B_API_KEY; the Python and JS SDKs pick it up automatically.
4. Close sandboxes explicitly when a task ends — this is the whole cost story.
Test it:
Not compute — lifetime. A sandbox that exists for three seconds costs about a hundredth of a cent; the same sandbox left open until a one-hour timeout costs the full ten cents, having done nothing for fifty-nine minutes and fifty-seven seconds of it. In an agent loop that spawns a sandbox per step, the difference between explicit teardown and timeout-based cleanup is most of your bill. Model the whole agent loop with the agent loop budget calculator, or the per-step economics with the agent step cost calculator.
Reference pricing (July 2026): sandboxes bill per second of lifetime — a default 2 vCPU sandbox is about $0.000028 per second, roughly $0.10 an hour, plus RAM at about $0.0000045 per GiB per second. Storage is included free up to 10 GiB on Hobby and 20 GiB on Pro. The Pro plan is $150 a month and mainly buys longer sessions, more concurrency and configurable CPU and RAM.
Yes. The Hobby plan is free, needs no credit card, and comes with a one-time $100 usage credit, sessions up to one hour, and up to 20 concurrent sandboxes. For most prototypes that credit lasts a long time, because a per-second sandbox that only lives for a few seconds per task costs a fraction of a cent.
Because the meter runs on sandbox existence, not on execution. An idle sandbox you forgot to close bills at the same rate as one running a workload. The single most effective cost control is closing sandboxes explicitly when a task finishes rather than letting them run to the session timeout — the difference between a two-second lifetime and a one-hour timeout is a factor of eighteen hundred.
Sign up at e2b.dev, open the dashboard and copy the API key from the keys section. The Hobby tier and its $100 credit are active immediately; the SDKs for Python and JavaScript take the key from the E2B_API_KEY environment variable.
Not affiliated with E2B. Prices are reference estimates — always verify on the official pricing page.