Runtime

Fly Machines vs Sprites: which Fly.io product fits agent sandboxes?

Sprites bill measured CPU and memory in use, and pause when idle; Machines bill their size while started, which is cheaper for 4 GB.

Runtime runs the same job for 55% less than a Fly Machine and 81% less than a Sprite. 1,000 one-minute runs of a 2 vCPU, 4 GiB sandbox cost $1.44 on a Machine, $3.31 on Sprites and $0.64 on Runtime. Runtime bills measured CPU like a Sprite, at about a third of its rate, and reserved memory at about a sixth of Sprites' memory rate. Rates checked 23 September 2026.

Estimated compute cost

81% less than Fly Sprites55% less than Fly Machines

2 vCPUs · 4 GiB · 60 s a run · 20 CPU-seconds busy

1,000

Compute only, at list rates checked 23 September 2026 (Fly.io pricing). Plan fees, network, taxes and free credits are left out. The worked example below shows the arithmetic.

At a glance

Both are Fly.io products, and both run Firecracker microVMs. Sprites are Fly's sandboxes for agents; Machines are its general-purpose VMs. Machine figures are for a performance-2x with 4 GB, at the rates of Fly's Ashburn (iad) region.

Fly Sprites Fly Machines Runtime
Isolation Firecracker microVM Firecracker microVM Firecracker microVM, own kernel
CPU $0.07 per CPU-hour of measured CPU By size while started: $0.0861 an hour for 2 vCPUs and 4 GB $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 Included in the size; more at $5 per GB a month $0.0075 per reserved GiB-hour
Size 100 GB disk; you pay for the bytes written Up to 16 performance vCPUs and 128 GB vCPUs and memory chosen per sandbox
When idle Pauses after about 30 s; compute billing stops Billed until stopped; a stop resets the root filesystem Pause keeps files, memory and processes, 1 to 365 days
Memory kept While warm; dropped when it goes cold With suspend, on Machines of 2 GB or less For the whole retention you set
Free start $30 of trial credit Not stated on the pricing page 50 sandbox hours, no card
Interfaces API, CLI, MCP server; JavaScript, Python, Go, Elixir SDKs Machines API and flyctl API, CLI, MCP server, JavaScript and Python SDKs

When is a Sprite cheaper than a Machine?

When it uses little memory. A Sprite's CPU is cheap for an agent that waits, because only measured CPU is billed: $0.39 for the job below. Its memory is not: $0.04375 per GB-hour of memory actually in use, $2.92 of the $3.31 total when all 4 GB are used. A Machine's $0.0861 an hour covers two performance vCPUs, whole cores kept for it, and 4 GB, busy or not.

For 1,000 one-minute runs with 20 CPU-seconds each, a Sprite that uses 1 GB costs $1.12, less than the Machine's $1.44. At about 1.4 GB in use they cost the same, and past that the Machine is cheaper: a Sprite that uses all 4 GB costs $3.31. The busier the CPU, the further the Machine pulls ahead, because its price does not change with load.

A shared-cpu-2x Machine with 4 GB costs about $0.50 for the same runs, but its shared vCPUs are guaranteed 6.25% of a core each and start with a small burst allowance, so a new one would not fit 20 CPU-seconds into the minute.

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 Machine is a performance-2x with 4 GB.

TextSprites   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.31Machines  Size   1,000 × 60 s / 3,600 × $0.0861       = $1.44Runtime   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, $143.50 on Machines 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 $1.44 on Machines, so Runtime is cheaper however busy the sandbox is. Both Fly figures assume the Sprite or Machine is removed when its run ends; a Sprite stays awake for about 30 seconds after its last activity. Storage, network, plan fees, taxes and free credits are left out.

What happens when the agent goes idle?

A Sprite handles it by itself. After about 30 seconds with nothing to do it pauses and compute billing stops. At first it is warm, with memory frozen in place, and the next request resumes it in 100 to 500 ms. Later it goes cold, dropping memory and processes, and wakes in 1 to 2 seconds with processes started fresh. Its disk survives both, and a sleeping Sprite's disk costs $0.02 per GB-month.

A Machine is billed for as long as it is started. Stopped, it costs storage only, but a stop resets its root filesystem, so files that must last go on a Fly Volume. Suspend keeps memory and resumes in a few hundred ms, but Fly lists 2 GB of memory or less as a requirement, so the 4 GB Machine here cannot use it.

A Runtime sandbox pauses when you call pause() or after idlePauseSeconds, keeps files, memory and processes for the retention you set, and wakes on the next request. Name it and the next process gets the same one back:

Pythonfrom withruntime import Sandboxdev = Sandbox.get_or_create("dev", idle_pause_seconds=900)dev.exec("git pull || true")

Which one to pick

  • Pick Sprites for a long-lived agent machine with a 100 GB disk that pauses itself between tasks, uses little memory and costs very little asleep.
  • Pick Machines for CPU-bound jobs, where whole performance cores at a flat hourly price are cheapest, for 18 regions, or for volumes and Managed Postgres in the same account.
  • Pick Runtime for measured CPU at about a third of the Sprite rate, memory you size and plan against, and a pause that keeps memory and processes for as long as you choose.

Switch from either one

From Sprites, the calls map one to one: client.createSprite(name) becomes Sandbox.create(), a Sprite by name becomes Sandbox.getOrCreate(name), and sprite.execFile(cmd, args) becomes exec([cmd, ...args]). From Machines, if you create a Machine for each job through the Machines API, create a Runtime sandbox instead and stop it when the job ends.

Or give your coding agent the one instruction in migration: it switches the project on a branch, tests it on the free trial and reports the monthly saving. npx withruntime switch --from fly before your first top-up matches that top-up with credit, up to $100, for either product. The full side-by-side is Runtime vs Fly.io; for each against Cloudflare, see Cloudflare Sandbox vs Fly Sprites and Cloudflare Sandbox vs Fly Machines.

Sources

Rates checked 23 September 2026; the Sprite lifecycle and Machine suspend pages read 25 September 2026.

Facts on this page were checked on 25 September 2026.