Modal vs CodeSandbox SDK

Modal gives you short-lived gVisor sandboxes on a big AI platform with GPUs and regions around the world, but each one ends within 24 hours. CodeSandbox SDK gives each sandbox a Firecracker VM that runs Docker, has no hard session cap, and hibernates with its memory to wake on the next request.

The companies and products

Modal

Modal is a serverless cloud for AI work: inference, training, batch jobs and sandboxed code, all driven from Python, TypeScript or Go code.

Modal Sandboxes are containers you create from code, run commands in, and then terminate. By default they run under gVisor, a user-space kernel from Google; since October 2026 you can also pick a VM runtime with its own Linux kernel for Docker and FUSE (Battleships tracks that as a separate card, Modal VM Sandboxes). It suits teams that already run models on Modal and want short-lived, scalable code execution next to their GPUs.

CodeSandbox SDK

CodeSandbox SDK is an API from CodeSandbox, now a Together AI company, that starts sandboxed development VMs on the same infrastructure as the CodeSandbox editor.

Each sandbox is a Firecracker microVM built from a template or any Dockerfile. When it goes idle it hibernates with a memory snapshot, and it resumes or forks from that snapshot in seconds. You drive it from a TypeScript SDK through terminals, commands, files and HTTPS hosts. Together's docs now call it the legacy offering and point new users to its successor, the together-sandbox SDK.

Self-hosting
Not offered

Which use cases each one fits

For each use case, Battleships prices every sandbox provider on the same workload and sorts them from the cheapest monthly bill up. “19th cheapest of 345” means 18 of the other 344 providers run that workload, with every feature it needs, for less. “With limits” means the provider runs it but misses something, so it is listed after every full match. Open a use case for its whole ranking and what each provider misses.

Use case and its workloadModal: price rankCodeSandbox SDK: price rankbochka: price rank
Software factory
100 at once · 4 vCPU / 8 GB · 2,200 sessions of 8 h a month
Can't run it178th of 367, with limits
$1,939 a month
3rd cheapest of 367
$634 a month
Always-on AI employees
50 machines 24/7 · 2 vCPU / 4 GB
An always-on agent hits Modal's 24-hour sandbox limit, while CodeSandbox SDK and bochka have no hard session cap.
196th of 366, with limits
$1,924 a month
215th of 366, with limits
$2,478 a month
5th cheapest of 366
$657 a month
Code interpreter bursts
100 at once · 1 vCPU / 2 GB · 200,000 sessions of 1 min a month
Both fit short code runs; Modal starts many sandboxes fast with high concurrency, while CodeSandbox SDK wakes a hibernated VM with its memory on the next request.
19th cheapest of 345
$181 a month
46th cheapest of 345
$642 a month
186th of 345, with limits
$2,000 a month
Sandboxes for your users
300 at once · 2 vCPU / 4 GB · 30,000 sessions of 23 min a month
Modal's Team plan fits 300 user sandboxes at once and CodeSandbox SDK's Scale plan caps at 250; bochka fits too and keeps each user's disk while it is stopped.
11th cheapest of 361
$811 a month
140th of 361, with limits
$1,707 a month
Cheapest of 361
$209 a month
RL rollouts
1,000 at once · 2 vCPU / 4 GB · 1,000,000 sessions of 3 min a month
Modal is built for huge bursts of short sandboxes, while CodeSandbox SDK's Scale plan stops at 250 VMs at once.
5th cheapest of 360
$19,038 a month
348th of 360, with limits
$3,861 a month
34th of 360, with limits
$2,000 a month
Agent evals
250 at once · 4 vCPU / 8 GB · 15,000 sessions of 20 min a month
59th cheapest of 364
$1,244 a month
64th cheapest of 364
$1,335 a month
10th cheapest of 364
$200 a month
CI runners
40 at once · 8 vCPU / 16 GB · 6,000 sessions of 12 min a month
CI that builds Docker images works on CodeSandbox SDK and on every bochka sandbox, while Modal needs its separate VM runtime for Docker.
126th cheapest of 377
$1,793 a month
92nd cheapest of 377
$860 a month
4th cheapest of 377
$86 a month
24/7 dev boxes
1 machine 24/7 · 4 vCPU / 8 GB
A dev box that lives all month loses its packages on Modal every day, keeps its disk on CodeSandbox SDK, and keeps its disk on bochka too.
138th of 368, with limits
$23 a month
310th of 368, with limits
$240 a month
18th cheapest of 368
$26 a month
Computer-use agents
50 at once · 4 vCPU / 8 GB · 20,000 sessions of 15 min a month
Neither Modal nor CodeSandbox SDK ships a desktop, so computer-use agents need one built by hand; bochka streams a 60fps desktop with Chromium in every sandbox.
98th of 369, with limits
$183 a month
206th of 369, with limits
$691 a month
6th cheapest of 369
$200 a month
Browser-use agents
50 at once · 2 vCPU / 4 GB · 30,000 sessions of 10 min a month
177th of 367, with limits
$136 a month
251st of 367, with limits
$443 a month
7th cheapest of 367
$200 a month
Scraping & bots (startup scale)
50 at once · 1 vCPU / 2 GB · 100,000 sessions of 3 min a month
267th of 346, with limits
$394 a month
281st of 346, with limits
$508 a month
6th cheapest of 346
$90 a month
Mass scraping & bots (undetectable)
1,000 at once · 1 vCPU / 2 GB · 3,000,000 sessions of 2 min a month
223rd of 338, with limits
$8,795 a month
193rd of 338, with limits
$7,390 a month
71st of 338, with limits
$1,800 a month
Parallel red teaming
200 at once · 2 vCPU / 4 GB · 5,000 sessions of 30 min a month
Can't run it240th of 360, with limits
$326 a month
2nd cheapest of 360
$200 a month
GPU eval jobs
10 at once · 8 vCPU / 32 GB · 500 sessions of 30 min a month
Modal rents GPUs from T4 to B300, and neither CodeSandbox SDK nor bochka has GPUs.
19th cheapest of 98
$1,187 a month
Can't run itCan't run it
macOS agents
5 at once · 4 vCPU / 8 GB · 1,000 sessions of 20 min a month
Can't run itCan't run itCan't run it

Key features

FeatureModalCodeSandbox SDKbochka
IsolationgVisor container by default; a VM runtime is sold as Modal VM SandboxesFirecracker microVM with its own kernelFull VM with its own kernel on dedicated AMD Ryzen 9 9950X hosts
Docker insideOnly with the VM runtimeYes, and sandboxes build from any DockerfileYes, with systemd and root, in every sandbox
Nested virtualizationVM runtime only, Team and Enterprise, on requestNot documentedYes, /dev/kvm for Android emulators and VMs
Longest session24 hours (default 5 minutes)No hard cap; hibernates after an idle timeout of up to one dayNo cap on paid plans; you set the time to live
Pause and resumeNo paused state; a finished sandbox is gone, only Volumes keep filesHibernates with a memory snapshot and resumes with processes runningDisk saved every minute and on stop; a stopped sandbox costs nothing and resume boots it again
ForkSnapshot the filesystem into an image and boot new sandboxes from itFork a hibernated sandbox, or a running one sharing its memoryFork a running sandbox with its disk, without stopping it
Wake on requestNoYes; an HTTP request to a host wakes the sandboxNo; a stopped sandbox is started by API
GPUsT4 to B300; 10 at once on Starter, 50 on TeamNoneNone
RegionsUS, EU and Asia-Pacific; pinning a region costs 1.15x to 1.75xA country hint steers scheduling, with no guaranteed placementEU only: Germany, Finland, France
Outbound network rulesBlock all, IP-range allowlist, domain allowlist (beta)No allowlist documentedNo provider-side allowlist
Shell accessSSH and exec from codeTerminals, commands and files through the SDK; no SSHSSH, plus exec and files over the API
Inbound accessEncrypted and raw TCP tunnels, connect tokens, inbound IP allowlistHTTPS host per port, public by default; no raw TCPHTTPS URLs for up to 50 ports, token-protected by default, plus raw TCP
Desktop and browserNot offered; an example shows how to set up VNC yourselfNo desktop; a headless Chromium template60fps Linux desktop, Chromium and a computer-use API built in
Coding agents and API keysExamples only; secrets are environment variables or your own sidecar proxyRun your own agent; secrets passed in as environment variablesClaude Code, Codex and others preinstalled with an API to drive them from outside; a credentials proxy keeps real keys out
Every feature Battleships tracks (43)
FeatureModalCodeSandbox SDKbochka
Full VM (own kernel)NoYesYes
Docker insideNoYesYes
Nested virtualizationNoNoYes
RootYesYesYes
SystemdYesNot publishedYes
Desktop GUINoNoYes
BrowserNoNoYes
Computer-use APINoNoYes
SSHYesNoYes
Persistent diskYesYesYes
Pause/resumeNoYesYes
Automatic snapshotsNoYesYes
Fork/cloneYesYesYes
Live fork (no pause)NoYesYes
Memory forkYesYesNo
Custom image (Docker or snapshot)YesYesYes
≥24 h sessionsYesYesYes
Idle auto-stopYesYesNo
Wake on requestNoYesNo
HTTPS preview URLsYesYesYes
Raw TCP inboundYesNoYes
Public IPv4NoNoNo
Egress allowlistYesNoNo
Secret proxyNoNoYes
Secret proxy for any APINoNoYes
Preinstalled agentsNoNoYes
Agent harness APINoNoYes
MCP serverNoNoNo
GPUYesNoNo
WindowsNoNoNo
Arm64NoNoNo
Self-hostingNoNoNo
BYOCNoNoNo
Open sourceNoNoNo
Scoped API keysNot publishedNot publishedYes
Spend limitsNot publishedNot publishedYes
Usage per sandbox (API)Not publishedNoYes
Audit logsYesNot publishedNo
SSOYesYesNo
SOC 2YesYesNo
HIPAAYesNoNo
EU data residencyYesNoYes
Zero data retentionNot publishedNot publishedYes

Performance

Modal12.79 runs/s
CodeSandbox SDKNot measured
bochka26.69 runs/s

On the StarSling hpc-sandbox-benchmarks Node.js build-and-test loop at 4 vCPU / 8 GB, run on 29 September 2026, bochka finished 26.69 runs per second and Modal's default gVisor sandbox 12.79, so bochka did about twice the work. CodeSandbox SDK was not part of that run, so there is no comparable CPU score for it.

Node.js build-and-test loop at 4 vCPU / 8 GB, higher is better. Measured with the open hpc-sandbox-benchmarks suite. Modal measured on: Sandbox (gVisor), request = size, any region. CodeSandbox SDK has no published run in this suite yet, so there is no like-for-like number to compare.

Pricing in five scenarios

Each bill is priced from the providers' public price lists by the open Battleships engine, with the cheapest plan that runs the scenario.

ScenarioModal, a monthCodeSandbox SDK, a monthbochka, a month
One coding agent, workdays
4 vCPU / 8 GB, 50 GB disk, 8 hours a day, 22 days a month, files kept between days
$15 · Starter · with limits$193 · Scale$20 · $20/mo
One agent that never stops
4 vCPU / 8 GB, 50 GB disk, running 24/7 all month
$178 · Starter · with limits$341 · Scale$26 · $20/mo
50 agents in parallel
50 machines of 4 vCPU / 8 GB at once, 8-hour sessions, 1,100 sessions a month, Docker inside
$2,229 · Starter · with limits$2,500 · Scale$317 · $20/mo × 3 seats
Sandboxes for your users
2 vCPU / 4 GB, 30,000 sessions of 10 minutes a month, up to 300 at once
$792 · Team$815 · Scale · with limits$200 · $100/mo × 2 seats
1,000 short jobs at once
2 vCPU / 4 GB, 1,000 at once, 3 minutes each, 200,000 jobs a month
$3,193 · Team · with limits$1,632 · Scale · with limits$2,000 · $2000/mo · with limits

Modal: Modal bills by the second for the higher of what you request and what you use, and an idle sandbox pays until it is terminated. Starter is free with $30 of monthly credit; Team is $250 a month with $100 of credit, and pinning a region multiplies the price by 1.15x to 1.75x.

CodeSandbox SDK: CodeSandbox SDK sells VM credits, and each size burns a fixed number per hour, billed per started minute, including idle time before hibernation. The Scale plan adds a $170 monthly platform fee that is not usage credit, and a hibernated VM costs nothing.

CodeSandbox SDK: bochka charges one hourly rate per machine size, by the second, only while a sandbox runs. Plans start at $20 a month, the whole fee becomes usage credit, and a stopped sandbox costs nothing.

Limits in those scenarios

Modal sandboxes last at most 24 hours and lose everything outside a Volume when they end, so the workday, always-on and fleet scenarios do not fit, and the 50-agent fleet also lacks Docker on the default runtime. CodeSandbox SDK's Scale plan allows 250 VMs at once, so 300 user sandboxes or 1,000 jobs at once need Enterprise, and its egress price and disk beyond 20 GiB are not published. bochka fits every scenario except the 1,000-job burst, where even the $2,000 plan queues starts.

ScenarioModalCodeSandbox SDKbochka
One coding agent, workdays
  • files survive a stop only in Volumes: packages installed elsewhere reset
  • disk beyond 20 GiB: price unknown
  • egress price not published
None that bite
One agent that never stops
  • Starter: sessions capped at 24 h
  • files survive a stop only in Volumes: packages installed elsewhere reset
  • disk beyond 20 GiB: price unknown
  • egress price not published
None that bite
50 agents in parallel
  • missing Docker inside
  • files survive a stop only in Volumes: packages installed elsewhere reset
  • egress price not published
None that bite
Sandboxes for your usersNone that bite
  • Scale: max 250 concurrent
  • egress price not published
None that bite
1,000 short jobs at once
  • shared vCPUs on this tier (Modal sells dedicated cores separately as “Sandbox (gVisor), request = size, any region”): heavy, sustained CPU use can be slowed by other tenants
  • Scale: max 250 concurrent
  • egress price not published
  • max 2,400 starts/day (needs ~6,667)
  • max 600 starts/hour (needs ~1,000)
  • bursts above 90 starts/min are queued (a burst of 333 takes ~4 min to start)

Which one should you use?

Use Modal when

your sandboxes need GPUs, must run outside Europe, or are huge bursts of short jobs that finish well inside a day.

  • GPUs on the same platform. Useful if your agent trains or runs models: Modal rents GPUs from T4 to B300 next to its sandboxes.
  • Regions and outbound rules. Modal runs in the US, EU and Asia-Pacific, and can block a sandbox's outbound traffic or allow only chosen domains.
  • Very large bursts. Good for huge bursts of short jobs: Modal runs up to 5,000 containers at once on Team.

Use CodeSandbox SDK when

you run previews or code runs that sleep between visits and should wake on the next HTTP request with their memory intact, and you are fine building on what Together now calls its legacy SDK.

  • Hibernation with memory. Useful for sandboxes that sleep between visits: a hibernated VM wakes on the next HTTP request with its processes still running.
  • Docker and no 24-hour cutoff. Each sandbox is a Firecracker VM that runs Docker and keeps going while it is in use, with no hard session cap.
  • Forks that share memory. Good for branching many runs from one warm state, since a fork can share memory with its running parent.

Where bochka fits

If your sandboxes are AI agents that work for hours on code, browsers or servers, look at bochka. Modal cuts sandboxes off at 24 hours and needs a separate runtime for Docker, and CodeSandbox SDK has no SSH, desktop or raw TCP. bochka gives each agent a full VM that keeps its disk and has the agent, desktop and key proxy already set up.

A full machine that keeps its work

On Modal a sandbox ends within 24 hours and only Volume files survive, so agents reinstall every session. CodeSandbox SDK keeps its disk but has no SSH or /dev/kvm, so emulator builds and nested VMs cannot run.

Desktop, agents and keys built in

Neither Modal nor CodeSandbox SDK ships a desktop or agent harness, so you wire up VNC and the agent yourself, and keys sit in environment variables a prompt injection can read. bochka streams a 60fps desktop and keeps keys in a proxy.

More CPU work per hour

In the same benchmark run, bochka did about twice the build-and-test work of Modal's default sandbox. CodeSandbox SDK has no comparable measurement, so its speed for installs and tests is unknown.

Use bochka when your agents work for hours or days: installs, builds, Docker, emulators, a desktop and servers others reach, on a fast full VM that keeps its disk. Compare it one to one: bochka vs Modal and bochka vs CodeSandbox SDK.

Questions people ask

Is Modal cheaper than CodeSandbox SDK?

Often, yes. One agent that never stops costs $178 a month on Modal against $341 on CodeSandbox SDK, and 300 user sandboxes cost $792 against $815. But Modal's 24-hour limit means the always-on agent does not really fit, and bochka does it for $26 a month.

Which is faster, Modal or CodeSandbox SDK?

Only Modal was measured: its default sandbox did 12.79 runs per second on a Node.js build-and-test loop at 4 vCPU / 8 GB. CodeSandbox SDK has no comparable score. bochka did 26.69 in the same run.

Can Modal and CodeSandbox SDK run Docker?

CodeSandbox SDK runs Docker inside its Firecracker VMs and builds sandboxes from any Dockerfile. Modal runs Docker only on its VM runtime, not the default gVisor sandbox. Every bochka sandbox runs Docker with systemd and root.

How long can a sandbox run on each?

A Modal sandbox lasts 5 minutes by default and 24 hours at most. CodeSandbox SDK has no hard cap and hibernates after an idle timeout of up to one day. bochka has no session cap on paid plans.

Is CodeSandbox SDK still maintained?

CodeSandbox is now part of Together AI. Together's docs call the CodeSandbox-based SDK deprecated and name together-sandbox as its successor, while self-serve sign-up still runs through CodeSandbox.

Does either have GPUs?

Modal rents GPUs from T4 to B300 on its gVisor sandboxes. CodeSandbox SDK and bochka have no GPUs, so pick Modal if your sandbox needs one.

Try bochka

Install the CLI, then run bochka new.

Product preview

More comparisons

Bochka product preview · Pricing, benchmarks and commands are illustrative. Sandbox provisioning is not connected.