# Run code inside your own product

> My app lets users or an LLM run code, and I need somewhere safe to run it.

A code interpreter is a sandbox your application calls: send code, get back the output, the errors and any files. Each run is short and thrown away, so the price of a second of compute, how quickly a sandbox starts and how many can run at once matter more than anything else.

Guide page: https://botperch.com/use-cases/code-interpreter/

**Short answer:** The cheapest machine that runs it as described is Agent 37 at $2.42 a month, then Runtime ($12.83) and Lizard ($19.00). 16 of 16 providers run it without a catch. Any AI model is billed separately and not priced here. List prices checked 29 October 2026.

This is infrastructure you build into a product, not something your users log into. Your server asks the provider's API for a sandbox, runs the code, collects the result and throws the sandbox away.
The code is untrusted by definition, so isolation is the first question: whether each run gets its own kernel, and what it can reach on the network. The [isolation](https://botperch.com/features/isolation/) and [outbound network](https://botperch.com/features/outbound-network/) pages compare that.

## What it needs

- **Machine size:** Small. Provider minimums run from 0.125 of a core and 128 MiB on Modal upwards. Battleships' interpreter workload uses 1 vCPU / 2 GiB / 5 GiB and fills 80% of that memory, so 2 vCPU / 4 GiB / 10 GiB is the safer size. [source](https://modal.com/docs/guide/resources)
- **Does it stay on?:** No. Each run lasts seconds to minutes; 20,000 one-minute runs a month is about 650 a day. [source](https://battleships.dev/data/presets.json)
- **What must survive a restart:** Usually nothing. Results go back to your app or your own storage. [source](https://battleships.dev/data/presets.json)
- **How busy it is:** About 17% CPU on average in Battleships' interpreter workload. Charging by the second, and only for CPU actually used, both matter here. [source](https://battleships.dev/data/presets.json)

## Picks

- **E2B**, The default choice: Built for exactly this. At the workload below it is about $55 a month at list price, and the free plan's one-time $100 credit covers most of the first two months. Watch: The free plan limits sessions to an hour and disk to 10 GiB. Concurrency limits are per plan. https://e2b.dev/pricing
- **Runtime**, If runs mostly wait: CPU is billed only while working, so the same workload is about $13 a month. Watch: Smaller company, one US region, and a free tier capped at four sandboxes at once. https://withruntime.com/docs/pricing
- **Cloudflare Sandbox**, If your app already runs on Cloudflare: Started from a Worker next to your code, with CPU billed only while working. Watch: The smallest size that has 2 vCPU also has 8 GiB of memory, which you pay for. There is a $5 monthly account minimum. https://developers.cloudflare.com/containers/platform/pricing/

## How to run it on each provider

- **E2B** (guide; no terminal: no): Its original use: a code-interpreter SDK and per-second billing. [E2B docs](https://e2b.dev/docs)
- **Daytona** (guide; no terminal: no): Sandboxes started from an SDK, billed per second, with $200 of free compute. [Daytona docs](https://www.daytona.io/docs/en/)
- **Modal** (guide; no terminal: no): Sandboxes from Python or JavaScript, sized down to a fraction of a core. [Modal: sandboxes](https://modal.com/docs/guide/sandboxes)
- **Vercel Sandbox** (guide; no terminal: no): Firecracker sandboxes from an SDK, with CPU billed only while working. [Vercel Sandbox](https://vercel.com/docs/sandbox)
- **Cloudflare Sandbox** (guide; no terminal: no): Sandboxes started from a Worker, with CPU billed only while working. [Cloudflare Sandbox SDK](https://developers.cloudflare.com/sandbox/get-started/)
- **Tensorlake** (guide; no terminal: no): Wrap `sandbox.run()` as a `run_code` tool and keep one sandbox per session so installed packages and written files carry between calls; the Tool Calls page has Claude, OpenAI and OpenAI Agents SDK examples. Pre-install the usual libraries in a snapshot so each session starts warm, and turn egress off or to an allowlist before running model-written code. [Tensorlake: tool calls](https://docs.tensorlake.ai/sandboxes/tool-calls)

## Monthly machine cost (preset `interpreter`)

20,000 one-minute runs a month on 2 vCPU / 4 GiB / 10 GiB machines, thrown away after each run; results go to your own storage. The CPU works about 17% of the time.

- Agent 37: $2.42
- Runtime: $12.83
- Lizard: $19.00
- Boat: $20.00
- InstaBox: $20.00
- Sandboxer: $20.00
- Tensorlake: $28.60
- Morph: $33.33
- Sprites: $35.90
- Cloudflare Sandbox: $37.78
- Vercel Sandbox: $42.77
- Modal: $49.32
- boxd: $50.32
- Blaxel: $55.20
- E2B: $55.20
- Daytona: $55.38

## Outside a sandbox

Anthropic's hosted code-execution tool runs Claude's code for you with no sandbox to manage: 1 CPU, 5 GiB, no internet, 1,550 hours included and then $0.05 per container-hour.

## Sources

- [Battleships: interpreter workload (built by the Boat team)](https://battleships.dev/data/presets.json)
- [Modal: resources](https://modal.com/docs/guide/resources)
- [Anthropic: code execution tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/code-execution-tool)
