# Fly Sprites vs CodeSandbox: pricing, persistence and limits Sprites bill measured CPU and memory in use on a persistent VM; CodeSandbox bills a fixed VM size by the minute. Both use Firecracker. **Runtime runs the same job for 81% less than Sprites and 74% less than CodeSandbox.** 1,000 one-minute runs of a 2 vCPU, 4 GiB sandbox cost $3.31 on Fly Sprites, $2.48 on CodeSandbox and $0.64 on Runtime. Runtime meters CPU like Sprites, at about a third of the rate, and bills by the second where CodeSandbox rounds up to the minute. Rates checked 23 September 2026. ## At a glance CodeSandbox's figures come from Together's documentation of the CodeSandbox SDK; CodeSandbox is a Together company. | | Fly Sprites | CodeSandbox SDK | Runtime | | ------------ | --------------------------------------------------------- | ---------------------------------------------------------- | --------------------------------------------------------- | | Isolation | Firecracker microVM | Firecracker microVM | Firecracker microVM, own kernel | | CPU | $0.07 per CPU-hour of measured CPU | Inside a fixed VM size | $0.025 per vCPU-hour of measured CPU, with a small floor | | Memory | $0.04375 per GB-hour of memory in use, managed by Fly | Inside the size: Nano is 2 cores and 4 GB, $0.1486 an hour | $0.0075 per reserved GiB-hour | | Billing unit | Usage while awake | By the minute, rounded up | By the second | | Disk | 100 GB, billed on what you use | Inside the VM | Included while running | | Plan fee | None required; optional monthly plans | Build free with 10 VMs at once; Scale $170 a month for 250 | None; prepaid credit from $10 | | Free start | $30 of trial credit | The free Build plan | 50 sandbox hours, no card | | State | Disk kept; memory kept in a warm pause, dropped when cold | Memory snapshot and restore at any point | Pause, snapshot and fork keep files, memory and processes | ## Is paying for what you use cheaper than a fixed size? Not at every rate. Sprites meter both CPU and memory, but the memory meter is $0.04375 per GB-hour. A Sprite holding 4 GB for a minute pays more for its memory alone ($2.92 per 1,000 runs) than a CodeSandbox Nano VM, with 2 cores and 4 GB, pays for everything ($2.48). With both CPUs busy the gap widens: $5.25 on Sprites against the same $2.48 on CodeSandbox, whose price does not move with the work. The order flips when a Sprite uses little memory. At 1 GB in use, the same 1,000 runs cost $1.12 on Sprites, against $1.24 on a CodeSandbox Pico VM (2 cores, 1 GB, 5 credits an hour). Runtime with 1 GiB reserved runs them for $0.26. So the answer depends on the meter's price, not only on whether it meters. Runtime measures CPU at $0.025 a vCPU-hour and reserves memory at $0.0075 per GiB-hour, below both rivals at every size in this page. ## Cost for the same job 1,000 runs of a 2 vCPU, 4 GiB 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; the CodeSandbox VM is a Nano, 10 credits an hour at $0.01486 a credit. ``` 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 CodeSandbox Size 1,000 × 60 s / 3,600 × $0.1486 = $2.48 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 $330.56 on Sprites, $247.67 on CodeSandbox and $63.89 on Runtime. With both CPUs busy for the whole minute, it is $1.33 on Runtime against $5.25 on Sprites and $2.48 on CodeSandbox, so Runtime is cheaper however busy the sandbox is. A Sprite stays awake about 30 seconds after its last activity, and a 40-second run on CodeSandbox is billed as a minute; neither is counted here. Plan fees, storage, network and free credits are left out. ## Which one to pick - **Pick Fly Sprites** for a long-lived computer an agent returns to, with a 100 GB disk that costs little while it sleeps and filesystem checkpoints in about a second. - **Pick CodeSandbox** for large fixed VMs, up to 64 cores and 128 GB, or for 250 VMs at once on its Scale plan. - **Pick Runtime** for the lowest price of the three at this size, busy or waiting, memory sized to the job, per-second billing, and pause that keeps memory for 1 to 365 days. ## Switch from either one From Sprites, `client.createSprite(name)` becomes `Sandbox.create()` and `sprite.execFile(cmd, args)` becomes `exec([cmd, ...args])`. From CodeSandbox, create a sandbox where you started a VM, and set its memory rather than picking a step: ```ts import { Runtime } from "withruntime"; const runtime = new Runtime(); const sbx = await runtime.sandboxes.create({ vcpu: 2, memoryMiB: 1024 }); try { const run = await sbx.exec(["python3", "-c", "print(6 * 7)"]); console.log(run.stdout); } finally { await sbx.stop(); } ``` 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 compare --from fly` (or `--from codesandbox`) prices what you ran at the old provider's rates, and `npx withruntime switch --from fly` before your first top-up matches that top-up with credit, up to $100. The full side-by-sides are [Runtime vs Fly.io](/docs/fly-alternative) and [Runtime vs CodeSandbox](/docs/codesandbox-alternative); the [sandbox cost calculator](/calculators/sandbox-cost-calculator) prices other sizes. ## Sources Rates checked 23 September 2026; the Sprites, Sprites lifecycle and Together pages read 25 September 2026. - [Fly.io pricing](https://fly.io/pricing/), [Sprites](https://fly.io/sprites/), [Sprites lifecycle](https://docs.fly.io/sprites/concepts/lifecycle/) - [Together Code Sandbox](https://docs.together.ai/docs/together-code-sandbox), [CodeSandbox SDK pricing](https://codesandbox.io/docs/sdk/pricing) - Runtime [pricing](/docs/pricing) Facts on this page were checked on 25 September 2026.