Skip to content
Runtime

Modal vs Fly Machines Fly Machines are 61% cheaper per agent run

Runtime Cloud (withruntime.com) costs 58% less than either. Fly Machines cost less than Modal.

Estimated compute cost2 vCPUs · 4 GiB · 60 s a run · 20 CPU-seconds busy

84% less than Modal58% less than Fly Machines

1,000

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

Which is better, Modal or Fly Machines?

It depends on whether you want a ready sandbox API or raw VMs to build on. If your agent mostly waits on model replies, Runtime is the cheapest here: $0.64 for 1,000 one-minute runs, against $1.53 on a Machine and $3.97 on Modal. Runtime is a sandbox API on Firecracker, with nothing to build. Pick Modal for GPU sandboxes, or for sandboxes beside Modal functions and scheduled jobs in one SDK. Pick Fly Machines to build your own layer on raw VMs in any of 17 regions, beside volumes and Managed Postgres.

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.0916704 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 $6 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 while you have credit
Regions Region selection at 1.15 to 1.75 times base prices 17 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 and start it through the Machines API. 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, and exec runs a command. 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();try {  await box.files.write("/workspace/invoice.py", "print(sum([125, 250, 375]))\n");  console.log((await box.exec("python3 /workspace/invoice.py", { 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, and a performance-2x Machine with 4 GB on Fly). Each run lasts 60 seconds and keeps the CPU busy for 20 CPU-seconds, because the agent mostly waits for a model.

Modal$3.97
CPU
1,000 × 60 s × 1 core × $0.00003942
$2.37
Memory
1,000 × 60 s × 4 × $0.00000667
$1.60
Machines$1.53
Size
1,000 × 60 s / 3,600 × $0.0916704
$1.53
Runtime$0.64
CPU
1,000 × 20 s / 3,600 × $0.025
$0.14
Memory
1,000 × 60 s / 3,600 × 4 × $0.0075
$0.50

At 100,000 runs a month, the cost is $396.60 on Modal, $152.78 on Machines, and $63.89 on Runtime. With both CPUs busy for the whole minute, the cost is $1.33 on Runtime, against $3.97 on Modal and $1.53 on Machines. 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.59 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 17 regions, beside volumes and Managed Postgres in one account.
  • Pick Runtime for a sandbox API on microVMs at 84% below Modal's price and 58% below a Machine's. CPU is billed as used, and pause keeps memory and processes with nothing to build.

Runtime Cloud

Runtime runs the same job for 84% less than Modal and 58% less than a Fly Machine. 1,000 one-minute runs of a 2 vCPU, 4 GiB sandbox cost $3.97 on Modal, $1.53 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 were checked 25 October 2026.

To try it, run npx withruntime login and use the free usage. The migration guide moves code from either one.

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 instruction in migration. It switches the project on a branch, tests it on the free usage, and reports the monthly saving. npx withruntime compare --from fly-machines prices your runs at the Machine rates. Credit you add within 30 days of signing up is matched, up to $1,000 in total. The full side-by-sides are Runtime vs Modal and Runtime vs Fly.io.

Sources

Fly.io prices were checked 25 October 2026.

Modal pricing and Modal Sandboxes pages were rechecked 26 October 2026. The rest were checked 25 October 2026.

Facts on this page were checked on 26 October 2026.

Keep comparing.

100 free hoursin your first 30 days.

of a 1 GB machine

  • No credit card
  • Four sandboxes at once, 2 vCPU and 4 GiB each
  • Then prepaid credit from $10, no plan fee
Start free, no card
Start free, no card