Modal vs Fly Machines: pricing, isolation and limits
Modal Sandboxes run under gVisor, billed per core-second; Fly Machines are Firecracker VMs billed by size while started. Machines cost less.
Runtime runs the same job for 84% less than Modal and 55% less than a Fly
Machine. 1,000 one-minute runs of a 2 vCPU, 4 GiB sandbox cost $3.97 on
Modal, $1.44 on a performance-2x Machine and $0.64 on Runtime, because
Runtime bills the CPU your code uses. It is a sandbox API: one call creates a
Firecracker microVM with its own kernel. Rates checked 23 September 2026.
Estimated compute cost
84% less than Modal55% less than Fly Machines
2 vCPUs · 4 GiB · 60 s a run · 20 CPU-seconds busy
Compute only, at list rates checked 23 September 2026 (Modal pricing, Fly.io pricing). Plan fees, network, taxes and free credits are left out. The worked example below shows the arithmetic.
At a glance
Fly's figures are at the rates of its Ashburn (iad) region. Modal bills a
physical core, which is two vCPUs.
| Modal Sandboxes | Fly Machines | Runtime | |
|---|---|---|---|
| What it is | A sandbox API beside Modal's functions | General-purpose VMs, driven by the Machines API and flyctl | A sandbox API with CLI, MCP server and SDKs |
| Isolation | gVisor, a user-space kernel that intercepts system calls | Firecracker microVM | Firecracker microVM, own kernel |
| CPU | $0.1419 per physical core-hour (2 vCPUs), request or use | By size while started; 2 performance vCPUs and 4 GB $0.0861 an hour | $0.025 per vCPU-hour of measured CPU, with a small floor |
| Memory | $0.0240 per GiB-hour, request or use | Included in the size; more at $5 per GB a month | $0.0075 per reserved GiB-hour |
| Plan fee | Starter $0 with $30 a month of compute; Team $250 a month | None; pay as you go | None; prepaid credit from $10 |
| When idle | 5-minute lifetime by default, up to 24 hours | Root disk is temporary; volumes keep files, suspend keeps memory | Pause keeps files, memory and processes, 1 to 365 days |
| Regions | Region selection at 1.15 to 1.75 times base prices | 18 regions | One US region |
Is a Fly Machine a sandbox?
A Machine is a general-purpose Firecracker VM, up to 16 performance vCPUs and 128 GB: you choose a size, start it through the Machines API, and it bills that size for every second it is started, busy or not. It is a good base to build sandboxes on, and the lifecycle is yours to write: create a Machine per job, add a volume if files must survive, and destroy it at the end. Its root disk is temporary.
Modal Sandboxes are a sandbox API. Sandbox.create and
exec start a gVisor sandbox inside a Modal App, with a 5-minute lifetime by
default and up to 24 hours. Filesystem snapshots carry state past that.
Runtime is a sandbox API on microVMs. Sandbox.create() returns a running
sandbox, exec runs a command, and pause keeps files, memory and running
processes, so there is no volume or snapshot to manage between an agent's
turns:
TypeScriptimport { 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();}Cost for the same job
1,000 runs of a 2 vCPU, 4 GiB sandbox (one physical core on Modal; a
performance-2x Machine with 4 GB on Fly). Each run lasts 60 seconds and
keeps the CPU busy for 20 CPU-seconds: an agent that mostly waits for a model.
TextModal CPU 1,000 × 60 s × 1 core × $0.00003942 = $2.37 Memory 1,000 × 60 s × 4 × $0.00000667 = $1.60 Total $3.97Machines 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.64At 100,000 runs a month that is $396.60 on Modal, $143.50 on Machines and $63.89 on Runtime. With both CPUs busy for the whole minute, it is $1.33 on Runtime against $3.97 on Modal and $1.44 on Machines, so Runtime is cheaper however busy the sandbox is. Storage, network, plan fees and free credits are left out.
A Machine's performance vCPUs are whole cores kept for it. Runtime's default
CPU is shared; cpu: "reserved" keeps every vCPU for you too. A
shared-cpu-2x Machine with 4 GB costs about $0.50 for the same runs, but its
vCPUs are guaranteed 6.25% of a core each, so a new one would not fit 20
CPU-seconds into the minute.
Which one to pick
- Pick Modal for GPU sandboxes, or sandboxes beside Modal functions and scheduled jobs in one SDK.
- Pick Fly Machines to build your own sandbox layer on raw VMs, in any of 18 regions, beside volumes and Managed Postgres in one account.
- Pick Runtime for a sandbox API on microVMs at a sixth of Modal's price and under half of a Machine's, with CPU billed as used and pause that keeps memory and processes with nothing to build.
Switch from either one
From Modal, the calls map one to one: modal.Sandbox.create(app=...) becomes
Sandbox.create(), sb.exec(*args) becomes exec, and idle_timeout
becomes idlePauseSeconds, with no App needed. 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. The
migration table lists the rest.
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 compare --from fly-machines prices your runs
at the Machine rates. npx withruntime switch --from modal (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 Modal and
Runtime vs Fly.io.
Sources
Modal pricing and Modal Sandboxes pages rechecked 25 September 2026; the rest checked 23 September 2026.
- Modal pricing, Modal resources and billing, Modal Sandboxes, Modal security
- Fly.io pricing, Machine CPU performance, Machine suspend and resume, Fly Volumes, Fly.io regions
- Runtime pricing
Facts on this page were checked on 25 September 2026.