Which is better, CodeSandbox or Morph?
It depends on whether people or agents use the machines. For agents that mostly wait on a model, Runtime has the lowest bill: $0.64 for 1,000 one-minute runs, against $1.67 on Morph and $2.48 on CodeSandbox, billed by the second with no one-minute minimum and no plan fee. Pick CodeSandbox for browser dev environments or 250 VMs on one plan; pick Morph to branch a running machine to hundreds of replicas, or for very large machines, up to 1,024 vCPUs on Scale.
At a glance
CodeSandbox's figures are from Together's documentation of the CodeSandbox SDK; CodeSandbox is a Together company.
| CodeSandbox SDK | Morph | Runtime | |
|---|---|---|---|
| Isolation | Firecracker microVM | Full virtual machines | Firecracker microVM, own kernel, every sandbox |
| How size is billed | Credits per VM size, $0.01486 a credit | $0.05 per MCU-hour: 1 vCPU, 4 GB of memory or 16 GB disk | $0.025 per vCPU-hour of measured CPU, with a small floor |
| 2 vCPU, 4 GB, an hour | $0.1486 (Nano, 10 credits) | $0.10 (2 MCUs) | $0.03125 waiting, $0.08 fully busy |
| Billing step | By the minute, rounded up | MCU-hours from a credit balance | By the second |
| Copies of a machine | Memory snapshots; clones a VM in under 3 seconds | Infinibranch: hundreds of replicas, memory included | Forks: 1 to 100 running copies with memory and processes |
| Plan fee | Build free; Scale $170 a month | Developer free with no credit; Team $40 and Scale $250 a month | None; prepaid credit from $10 |
| At once | 10 VMs on Build, 250 on Scale | Devboxes: 8 on Free, 32 on Team, 128 on Scale | 100 paid; four without credit |
| Free start | The free Build plan | No free credit; 1,000 MCUs come with Team ($40) | 100 free hours of a 1 GB machine in the first 30 days, no card |
Which is better for forking a running machine?
Both keep memory, which is what makes a copy useful to an agent: a copy that has to boot again and reinstall its dependencies saves little.
- CodeSandbox takes memory snapshots and, in Together's words, clones a template "in under three seconds". A sandbox can start from a template snapshot, resume from hibernation or boot clean.
- Morph branches a running machine with its memory to hundreds of parallel replicas with Infinibranch, and snapshots keep memory and disk. Snapshot storage comes out of the same MCU balance: one MCU covers 5 TB snapshot-hours.
For branching wide, to hundreds of copies in parallel, Morph is built for it. For
the everyday case, an agent that tries a few approaches from one prepared
state, Runtime's fork makes 1 to 100 running copies with their memory and
processes in one call, billed as ordinary sandboxes, and the snapshot the fork
takes for itself is free.
Cost for the same job
1,000 runs of a 2 vCPU, 4 GiB sandbox: a Nano VM on CodeSandbox (2 cores, 4 GB, 10 credits an hour) and 2 MCUs on Morph. Each run lasts 60 seconds and keeps the CPU busy for 20 CPU-seconds: an agent that mostly waits for a model.
- Size
- 1,000 × 60 s / 3,600 × $0.1486
- $2.48
- Size
- 1,000 × 60 s / 3,600 × 2 MCU × $0.05
- $1.67
- 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 that is $247.67 on CodeSandbox, $166.67 on Morph and $63.89 on Runtime. With both CPUs busy for the whole minute, it is $1.33 on Runtime against $2.48 on CodeSandbox and $1.67 on Morph, so Runtime is cheaper however busy the sandbox is. Each run here is a whole minute, so CodeSandbox's rounding adds nothing; a 40-second run would still be billed as a minute there. Plan fees, included credit, storage, network and taxes are left out.
Which one to pick
- Pick CodeSandbox for development environments in the browser: sessions reconnect with page visibility and hibernate on request, or for up to 250 VMs concurrently on one plan.
- Pick Morph for branching at scale, to hundreds of replicas of a running machine, or for very large machines: Scale allows up to 1,024 vCPUs and 4,096 GB of memory.
- Pick Runtime for a Firecracker microVM at 74% less than CodeSandbox and 62% less than Morph, billed by the second with no one-minute minimum, CPU and memory chosen apart, and no plan fee.
Switch from either one
Neither has a drop-in import on Runtime; the calls map directly (map the calls): create, exec, files and stop each have one equivalent. A fork of a prepared machine looks like this:
TypeScriptimport { Sandbox } from "withruntime";await using base = await Sandbox.create();await base.exec("pip install --quiet requests");const [a, b] = await base.fork({ count: 2 }); // both running, answered togetherconsole.log((await a!.exec("python3 -c 'import requests; print(1)'")).stdout);await Promise.all([a!.stop(), b!.stop()]);Pythonfrom withruntime import Sandboxwith Sandbox.create() as base: base.exec("pip install --quiet requests") forks = base.fork(count=2) # copies as it is now, running print(forks[0].exec("python3 -c 'import requests; print(1)'").stdout) for fork in forks: fork.stop()Or give your coding agent the one 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 codesandbox (or
--from morph) prices what you ran at the old provider's rates. The full
side-by-sides are Runtime vs CodeSandbox and
Runtime vs Morph; snapshots are explained in
sandbox snapshot.
Runtime Cloud
Runtime runs the same job for 74% less than CodeSandbox and 62% less than Morph. 1,000 one-minute runs of a 2 vCPU, 4 GiB sandbox cost $2.48 on CodeSandbox, $1.67 on Morph and $0.64 on Runtime, because Runtime bills the CPU your code uses rather than the machine's full size. Rates checked 25 October 2026.
To try it, open an account with npx withruntime login and spend the free usage on a real job. Follow the migration guide to move the rest.
Sources
Rates checked 25 October 2026. Together's CodeSandbox SDK documentation and Morph's pricing page reread 26 October 2026.
- Together: CodeSandbox SDK, CodeSandbox SDK pricing
- Morph Cloud pricing, Morph Devboxes
- Runtime pricing and JavaScript SDK
Facts on this page were checked on 26 October 2026.