CodeSandbox vs Morph: pricing, isolation and limits
CodeSandbox sells fixed microVM sizes billed per minute; Morph bills VMs in MCUs. A 2 vCPU, 4 GB job costs $2.48 and $1.67 respectively.
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 23 September 2026.
Estimated compute cost
74% less than CodeSandbox62% less than Morph
2 vCPUs · 4 GiB · 60 s a run · 20 CPU-seconds busy
Compute only, at list rates checked 23 September 2026 (Together Code Sandbox, Morph Cloud pricing). Plan fees, network, taxes and free credits are left out. The worked example below shows the arithmetic.
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 10 running copies with memory and processes |
| Plan fee | Build free; Scale $170 a month | Free with no credit; Developer $40 and Team $250 a month | None; prepaid credit from $10 |
| At once | 10 VMs on Build, 250 on Scale | Devboxes: 8 on Free, 32 on Developer, 128 on Team | 100 on a paid account to start; eight on the trial |
| Free start | The free Build plan | No free credit; 1,000 MCUs come with Developer ($40) | 50 sandbox hours, 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 VM "in under 3 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 at once, 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 10 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.
TextCodeSandbox Size 1,000 × 60 s / 3,600 × $0.1486 = $2.48Morph Size 1,000 × 60 s / 3,600 × 2 MCU × $0.05 = $1.67Runtime 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 $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 at once on one plan.
- Pick Morph for branching at scale, to hundreds of replicas of a running machine, or for very large machines: Team 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(funding="trial") as base: base.exec("pip install --quiet requests") forks = base.fork(count=2, funding="trial") # 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 trial 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.
Sources
Rates checked 23 September 2026. Together's Code Sandbox documentation and Morph's pricing page reread 25 September 2026.
- Together Code Sandbox, CodeSandbox SDK pricing
- Morph Cloud pricing, Morph Devboxes
- Runtime pricing and JavaScript SDK
Facts on this page were checked on 25 September 2026.