# Runtime vs Cloudflare Sandbox Runtime and Cloudflare's Sandbox SDK both run agent code in a VM and bill CPU by use; Runtime charges less, needs no Worker, and a pause keeps files and memory. This page compares the two for teams looking for a Cloudflare Sandbox SDK alternative. Cloudflare's sandboxes run on Cloudflare Containers, so their prices are the Containers prices. Facts about Cloudflare come from its public pricing and documentation, checked 23 September 2026; check the links at the end before relying on them. Equal vCPU counts do not prove equal performance, and the two services have not been benchmarked against each other. ## At a glance | | Runtime | Cloudflare Sandbox SDK | | -------------- | --------------------------------------------------------- | -------------------------------------------------------- | | Isolation | Firecracker microVM, own kernel | A container in its own VM | | CPU billing | $0.025 per vCPU-hour of measured CPU, with a small floor | $0.072 per active vCPU-hour, metered in 10 ms steps | | Memory billing | $0.0075 per reserved GiB-hour | $0.009 per provisioned GiB-hour | | Disk | Included while running; paused storage $0.08 per GB-month | $0.000252 per provisioned GB-hour | | Plan fee | None; prepaid credit from $10 | Workers Paid, at least $5 a month | | Free start | 20 sandbox hours, no card | No free tier; the plan includes 375 vCPU-minutes a month | | Sizes | vCPUs and memory chosen per sandbox | Up to 4 vCPUs, 12 GiB and 20 GB; at least 3 GiB per vCPU | | When idle | Pause keeps files and memory; paid retention 1–365 days | Sleeps after 10 idle minutes by default; files are lost | | Where it runs | One region | Cloudflare's network, near the request that starts it | | Interfaces | API, CLI, MCP server, JavaScript and Python SDKs | A TypeScript SDK called from a Cloudflare Worker | ## Cost for the same job Take 1,000 runs of a 2 vCPU sandbox. Each run lasts 60 seconds and keeps the CPU busy for 20 CPU-seconds, which is typical of an agent that spends most of its time waiting for a model. Runtime gets 4 GiB. Cloudflare's smallest 2 vCPU size has 6 GiB, because a custom size needs at least 3 GiB per vCPU; it gets 12 GB of disk, the size in Cloudflare's own example. ``` Runtime CPU 1,000 × 20 s / 3,600 × $0.025 = $0.14 Memory 1,000 × 60 s / 3,600 × 4 × $0.0075 = $0.50 Total $0.64 Cloudflare CPU 1,000 × 20 s × $0.000020 = $0.40 Memory 1,000 × 60 s × 6 × $0.0000025 = $0.90 Disk 1,000 × 60 s × 12 × $0.00000007 = $0.05 Total $1.35 ``` Both bill CPU by use, so the gap holds as a workload gets busier: with both CPUs busy for the whole minute, the same job costs $1.33 on Runtime and $3.35 on Cloudflare. The Cloudflare figure assumes each sandbox is destroyed when its run ends; one that is left alone keeps billing memory and disk until it has been idle for 10 minutes. Workers requests, Durable Object time, the $5 plan minimum, network, taxes and free allowances are excluded from both. See [pricing](./pricing) for Runtime's terms. ## Where Cloudflare is stronger - **Placement.** A Cloudflare sandbox starts in the nearest location that has its image, across Cloudflare's network. Runtime runs in one region. - **Scale.** A Cloudflare account can run 1,500 vCPUs and 6 TiB of memory at once. A paid Runtime account runs 10 sandboxes, 32 vCPUs and 64 GiB at once by default, more on request. - **Platform.** If your application already runs on Workers, sandboxes share its account, billing and bindings, and a backup of a directory goes to R2, where other sandboxes can restore it. - **Track record.** Cloudflare has run its network for years; Containers and the Sandbox SDK became generally available in April 2026. Runtime opened public signup in September 2026 and has not completed an outside security audit. - **Snapshots.** Runtime's are paused while an issue is fixed; build a [custom image](./javascript#custom-images) to start many sandboxes from one setup. ## Where Runtime is stronger - **Price.** Active CPU costs about a third as much, memory is a little cheaper, and you size memory to the job rather than to a minimum per vCPU. - **Memory survives a pause.** A paused Runtime sandbox wakes with its files and processes. A Cloudflare sandbox that sleeps starts again from its image; keeping work means backing up a directory to R2 first. - **Any backend.** Runtime is an API you call from any server, with JavaScript and Python SDKs, a CLI and an [MCP server](./mcp). The Sandbox SDK runs inside a Worker, deployed with Wrangler and a local Docker build. - **Setup by the agent.** An agent runs `npx withruntime run --trial -- ...`, shows you a link, and starts work once you approve it in the browser. No API key is copied into a prompt or a config file. - **No platform to join.** Runtime needs no Workers plan or project; prepaid credit is the whole account. ## Moving from Cloudflare Cloudflare, inside a Worker (the stable `@cloudflare/sandbox` package; the 1.0 preview returns a process handle from `exec` instead): ```js import { getSandbox } from "@cloudflare/sandbox"; export { Sandbox } from "@cloudflare/sandbox"; export default { async fetch(request, env) { const sandbox = getSandbox(env.Sandbox, "my-sandbox"); const result = await sandbox.exec("python3 -c 'print(6 * 7)'"); await sandbox.destroy(); return Response.json({ stdout: result.stdout }); }, }; ``` Runtime, from any server: ```ts import { Sandbox } from "withruntime"; const box = await Sandbox.create({ funding: "trial" }); try { console.log((await box.exec("python3 -c 'print(6 * 7)'", { check: true })).stdout); } finally { await box.stop(); } ``` To have a coding agent make the switch, test it and compare costs on your own workload, give it the prompt in [migration](./migrate). Keep Cloudflare available until the same job passes on both. ## Sources - [Cloudflare Containers pricing](https://developers.cloudflare.com/containers/pricing/) - [Sandbox SDK pricing](https://developers.cloudflare.com/sandbox/platform/pricing/) - [Containers limits and instance types](https://developers.cloudflare.com/containers/platform/limits/) - [Containers architecture](https://developers.cloudflare.com/containers/concepts/architecture/) - [Sandbox lifecycle](https://developers.cloudflare.com/sandbox/concepts/sandboxes/) and [sandbox options](https://developers.cloudflare.com/sandbox/configuration/sandbox-options/) - [Sandbox backup and restore](https://developers.cloudflare.com/sandbox/guides/backup-restore/) - [Workers pricing](https://developers.cloudflare.com/workers/platform/pricing/) - [Containers and Sandboxes generally available](https://developers.cloudflare.com/changelog/post/2026-04-13-containers-sandbox-ga/) - Runtime [pricing](./pricing), [security](./security) and [products](./products)