Vercel Sandbox vs CodeSandbox SDK: pricing, sizes and limits
Both run Firecracker microVMs. Vercel bills active CPU plus memory; the CodeSandbox SDK bills a fixed VM size by the minute, rounded up.
Runtime runs the same job for 70% less than Vercel and 74% less than CodeSandbox. 1,000 one-minute runs of a 2 vCPU, 4 GiB sandbox cost $2.12 on Vercel, $2.48 on CodeSandbox and $0.64 on Runtime. Runtime bills measured CPU by the second, with no one-minute minimum, and lets you pick any shape rather than a fixed size. Rates checked 23 September 2026.
Estimated compute cost
70% less than Vercel Sandbox74% less than CodeSandbox
2 vCPUs · 4 GiB · 60 s a run · 20 CPU-seconds busy
Compute only, at list rates checked 23 September 2026 (Vercel Sandbox pricing, Together Code Sandbox). Plan fees, network, taxes and free credits are left out. The worked example below shows the arithmetic.
At a glance
Vercel's figures are at the rates of its default iad1 region. CodeSandbox's
come from Together's documentation of the CodeSandbox SDK; CodeSandbox is a
Together company.
| Vercel Sandbox | CodeSandbox SDK | Runtime | |
|---|---|---|---|
| Isolation | Firecracker microVM, own kernel | Firecracker microVM | Firecracker microVM, own kernel |
| CPU | $0.128 per active CPU-hour | By VM size: Nano (2 cores, 4 GB) is $0.1486 an hour | $0.025 per vCPU-hour of measured CPU, with a small floor |
| Memory | $0.0212 per provisioned GB-hour; 2 GB per vCPU | Inside the VM size | $0.0075 per reserved GiB-hour |
| Billing step | Memory in 1-minute minimum increments | Each VM's runtime rounded up to the minute | By the second |
| Largest machine | 8 vCPUs and 16 GB on Pro; 32 and 64 GB on Enterprise | 64 cores and 128 GB | vCPUs and memory chosen per sandbox |
| Plan fee | Hobby allowance free; usage beyond it needs Pro | Build free with 10 VMs at once; Scale $170 a month | None; prepaid credit from $10 |
| At once | 10 on Hobby, 10,000 on Pro | 10 on Build, 250 on Scale | 8 on the trial, 100 paid to start, raised on request |
| Snapshots, forks | The filesystem; processes start again | Memory snapshot and restore | Files, memory and running processes |
Which one bills less for short runs?
Neither rival bills a run of a few seconds by the second. CodeSandbox rounds each VM's runtime up to the next minute, so a 10-second run is billed as 60. Vercel bills active CPU as used, but provisioned memory in 1-minute minimum increments, so a 10-second run still pays a minute of memory: $0.00141 for 4 GB.
Runtime bills both CPU and memory by the second. A 10-second run of a 2 vCPU, 4 GiB sandbox that keeps one CPU busy throughout costs about $0.00007 in CPU and $0.00008 in memory.
For whole-minute runs, the comparison turns on how busy the code is. CodeSandbox's Nano costs the same whether its cores are busy or idle. Vercel's bill grows with CPU use, and it passes CodeSandbox's at about 30 CPU-seconds per one-minute run of a 2 vCPU sandbox. With both CPUs busy the whole minute, Vercel costs more than twice as much.
Which scales further?
CodeSandbox's VMs go up to 64 cores and 128 GB, far above Vercel's 8 vCPUs and 16 GB on Pro. Vercel runs more at once: 10,000 on Pro, against 250 on CodeSandbox's $170-a-month Scale plan and 10 on its free Build plan. A paid Runtime account runs 100 sandboxes at once to start, with no plan fee, and the limit is raised on request.
Every Runtime sandbox gets the shape you ask for, and files move in and out with one call each:
TypeScriptimport { Sandbox } from "withruntime";await using sbx = await Sandbox.create({ funding: "trial" });await sbx.files.write("/workspace/main.py", "print(sum(range(10)))\n");const run = await sbx.exec("python3 /workspace/main.py", { check: true });console.log(run.stdout); // 45Cost for the same job
1,000 runs of a 2 vCPU sandbox with 4 GiB, 4 GB on Vercel, and a CodeSandbox Nano VM, 10 credits an hour at $0.01486 a credit. Each run lasts 60 seconds and keeps the CPU busy for 20 CPU-seconds: an agent that mostly waits for a model.
TextVercel CPU 1,000 × 20 s / 3,600 × $0.128 = $0.71 Memory 1,000 × 60 s / 3,600 × 4 × $0.0212 = $1.41 Total $2.12CodeSandbox Size 1,000 × 60 s / 3,600 × $0.1486 = $2.48Runtime 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 $212.44 on Vercel, $247.67 on CodeSandbox and $63.89 on Runtime. With both CPUs busy for the whole minute, it is $1.33 on Runtime against $5.68 on Vercel and $2.48 on CodeSandbox, so Runtime is cheaper however busy the sandbox is. Each run here is a whole minute, so neither rival's rounding adds anything. Plan fees, creations, storage, network and free allowances are left out.
Which one to pick
- Pick Vercel Sandbox if your app is on Vercel, or you need thousands of sandboxes at once in a region you choose.
- Pick CodeSandbox for very large machines, up to 64 cores and 128 GB, or memory snapshots of development environments.
- Pick Runtime for per-second billing of measured CPU, any shape, 100 sandboxes at once with no plan fee, and forks that keep memory and running processes.
Switch from either one
From Vercel Sandbox, change one import. There is no Vercel project or token to carry over:
TypeScriptimport { Sandbox } from "withruntime/vercel"; // was: from "@vercel/sandbox"Pythonfrom withruntime.vercel import sandbox # was: from vercel import sandboxFrom the CodeSandbox SDK, map creating a VM, running commands, reading and
writing files, and shutting down with the table in
migration; a memory snapshot becomes
snapshot() or pause().
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. From Vercel, npx withruntime switch --from vercel before
your first top-up matches that top-up with credit, up to $100. The full
side-by-sides are Runtime vs Vercel Sandbox
and Runtime vs CodeSandbox.
Sources
Vercel Sandbox pricing rechecked 25 September 2026; the rest checked 23 September 2026.
- Vercel Sandbox pricing, Understanding Vercel Sandboxes
- Together Code Sandbox, CodeSandbox SDK pricing
- Runtime pricing
Facts on this page were checked on 25 September 2026.