# Cloudflare Sandbox vs Fly Sprites: pricing, persistence and limits Both bill measured CPU at about $0.07 a CPU-hour; Sprites keep files when idle and bill memory in use, Cloudflare loses files on sleep. **Runtime runs the same job for 53% less than Cloudflare and 81% less than Sprites.** 1,000 one-minute runs of a 2 vCPU sandbox with 4 GB in use cost $1.35 on Cloudflare, $3.31 on Sprites and $0.64 on Runtime. All three bill CPU as measured; Runtime's rate is $0.025 a vCPU-hour, about a third of either rival's, and a paused Runtime sandbox keeps its memory for as long as you choose. Rates checked 23 September 2026. ## At a glance Cloudflare's sandboxes run on Cloudflare Containers, so their prices are the Containers prices. | | Cloudflare Sandbox SDK | Fly Sprites | Runtime | | ---------- | -------------------------------------------------------- | -------------------------------------------------------------- | --------------------------------------------------------- | | Isolation | A container in its own VM | Firecracker microVM | Firecracker microVM, own kernel | | CPU | $0.072 per active vCPU-hour, metered in 10 ms steps | $0.07 per CPU-hour of measured CPU | $0.025 per vCPU-hour of measured CPU, with a small floor | | Memory | $0.009 per provisioned GiB-hour; at least 3 GiB per vCPU | $0.04375 per GB-hour of memory in use; managed by Fly | $0.0075 per reserved GiB-hour | | Disk | $0.000252 per provisioned GB-hour | 100 GB; you pay for the bytes written | Included while running; paused storage $0.08 per GB-month | | Plan fee | Workers Paid, at least $5 a month | None required; optional monthly plans | None; prepaid credit from $10 | | Free start | No free tier; the plan includes 375 vCPU-minutes a month | $30 of trial credit | 50 sandbox hours, no card | | When idle | Sleeps after 10 idle minutes by default; files are lost | Pauses after about 30 seconds; disk kept, memory kept at first | Pause keeps files, memory and processes, 1 to 365 days | | Interfaces | A TypeScript SDK called from a Cloudflare Worker | API, CLI, MCP server; JavaScript, Python, Go, Elixir SDKs | API, CLI, MCP server, JavaScript and Python SDKs | ## Which one keeps my work when the agent goes idle? Sprites, of the two. After about 30 seconds with nothing to do, a Sprite pauses and compute billing stops. At first it is warm: memory is frozen in place and the next request resumes it in 100 to 500 ms. Later it goes cold, dropping memory and running processes, and the next wake takes 1 to 2 seconds with processes started fresh. Its disk survives both: files, installed packages and git repositories stay. A Cloudflare sandbox sleeps after 10 idle minutes by default, configurable with `sleepAfter`, or never with `keepAlive: true`. When it stops, all files are deleted, all processes end and shell state resets. Anything that must last has to be backed up to R2 first. A paused Runtime sandbox keeps its files, its memory and its running processes, all three kept for the retention you set, 1 to 365 days, and it wakes by itself on the next request. ## Cost for the same job 1,000 runs of a 2 vCPU sandbox. Each run lasts 60 seconds and keeps the CPU busy for 20 CPU-seconds: an agent that mostly waits for a model. The Sprite is assumed to use all 4 GB for the whole minute, and Runtime gets 4 GiB. Cloudflare's smallest 2 vCPU size has 6 GiB, because it needs at least 3 GiB per vCPU, and it gets 12 GB of disk, the size in Cloudflare's own example. ``` 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 Sprites CPU 1,000 × 20 s / 3,600 × $0.07 = $0.39 Memory 1,000 × 60 s / 3,600 × 4 × $0.04375 = $2.92 Total $3.31 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 ``` At 100,000 runs a month that is $135.04 on Cloudflare, $330.56 on Sprites and $63.89 on Runtime. With both CPUs busy for the whole minute, it is $1.33 on Runtime against $3.35 on Cloudflare and $5.25 on Sprites, so Runtime is cheaper however busy the sandbox is. Plan fees, Workers requests, Durable Object time, stored disk, network and free credits are left out. The two CPU rates are almost the same; memory decides it. A Sprite pays only for memory it actually uses, so one that uses 1 GB costs $1.12 for these runs, less than Cloudflare's $1.35, while Cloudflare bills its 6 GiB whether it is used or not. The Cloudflare figure also assumes each sandbox is destroyed when its run ends; one left alone bills its memory and disk until it has been idle for 10 minutes. ## Which one to pick - **Pick Cloudflare Sandbox** if your app already lives on Workers and you want sandboxes that share its account, billing and bindings, placed near users across Cloudflare's network. - **Pick Fly Sprites** for a long-lived agent machine with a 100 GB disk that pauses itself between tasks, and very cheap sleep: a sleeping Sprite's disk costs $0.02 per GB-month. - **Pick Runtime** for measured CPU at about a third of either rate, memory you size and plan against, and a pause that keeps memory and processes until you wake it. ## Switch from either one The calls map one to one. Cloudflare's `getSandbox(env.Sandbox, name)` and a Sprite by name both become `Sandbox.getOrCreate(name)`, which answers the sandbox with that name, woken if it is paused, or creates one. `sandbox.exec(cmd)` becomes `exec(cmd)`, and `sprite.execFile(cmd, args)` becomes `exec([cmd, ...args])`: ```ts check import { Sandbox } from "withruntime"; const dev = await Sandbox.getOrCreate("dev", { idlePauseSeconds: 900 }); await dev.exec(["python3", "-c", "print(6 * 7)"]); // The next process, or tomorrow, gets the same sandbox and its files. ``` Cloudflare's `proxyToSandbox` becomes `box.previews.create(port)`, served from Runtime's own address rather than through your Worker. Or give your coding agent the one instruction in [migration](/docs/migrate): it switches the project on a branch, tests it on the free trial and reports the monthly saving. `npx withruntime switch --from cloudflare` (or `--from fly`) before your first top-up matches that top-up with credit, up to $100. The full side-by-sides are [Runtime vs Cloudflare](/docs/cloudflare-sandbox-alternative) and [Runtime vs Fly.io](/docs/fly-alternative); for the two Fly products, see [Fly Machines vs Sprites](/compare/fly-machines-vs-fly-sprites). ## Sources Rates checked 23 September 2026; the Sprite and Cloudflare sandbox lifecycle pages read 25 September 2026. - [Cloudflare Containers pricing](https://developers.cloudflare.com/containers/pricing/), [Containers limits and instance types](https://developers.cloudflare.com/containers/platform/limits/), [Sandbox lifecycle](https://developers.cloudflare.com/sandbox/concepts/sandboxes/), [Sandbox backup and restore](https://developers.cloudflare.com/sandbox/guides/backup-restore/) - [Fly.io pricing](https://fly.io/pricing/), [Sprites](https://fly.io/sprites/), [Sprite lifecycle and persistence](https://docs.fly.io/sprites/concepts/lifecycle/) - Runtime [pricing](/docs/pricing) Facts on this page were checked on 25 September 2026.