CodeSandbox SDK vs Railway
CodeSandbox SDK puts each sandbox in a Firecracker VM that hibernates with its memory and wakes on the next HTTP request. Railway is an app platform whose sandbox VMs are destroyed when they go idle, but sit on the same private network as your apps and databases.
The companies and products
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.
Railway
Railway is a cloud platform for deploying web apps, servers and databases, which now also sells sandboxes and cloud agents.
Railway's main product is app hosting: you deploy services and databases as containers on its own hardware. In 2026 it added Sandboxes, isolated Linux VMs you create from the CLI or a TypeScript SDK, run commands in and destroy, and Cloud Agents, a personal VM for running a coding agent, in early access. It suits teams already hosting on Railway who want throwaway machines next to their apps.
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. “46th cheapest of 345” means 45 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 workload | CodeSandbox SDK: price rank | Railway: price rank | boat: price rank |
|---|---|---|---|
| Software factory 100 at once · 4 vCPU / 8 GB · 2,200 sessions of 8 h a month CodeSandbox SDK keeps a sandbox's disk and memory through hibernation, while a Railway sandbox is destroyed when idle unless you checkpoint it; boat keeps a full VM's disk with Docker and /dev/kvm. | 178th of 367, with limits $1,939 a month | 51st of 367, with limits $342 a month | 3rd cheapest of 367 $634 a month |
| Always-on AI employees 50 machines 24/7 · 2 vCPU / 4 GB Railway fits an always-on assistant if you set the idle timeout to 0 or use a Cloud Agent, with memory billed the whole time; CodeSandbox SDK is only a compromise here. | 215th of 366, with limits $2,478 a month | 16th cheapest of 366 $3,977 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: CodeSandbox SDK wakes a hibernated VM with its memory, and Railway bills for CPU used and destroys the sandbox when the job ends, while boat's start limits make it a compromise here. | 46th cheapest of 345 $642 a month | 36th cheapest of 345 $413 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 CodeSandbox SDK allows 250 VMs at once on Scale and Railway 100 per environment on Pro, so 300 user sandboxes need Enterprise or several environments; boat fits this one. | 140th of 361, with limits $1,707 a month | 42nd of 361, with limits $290 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 CodeSandbox SDK can fork a running VM that shares its memory, so rollouts branch from one warm state; Railway forks only the filesystem. | 348th of 360, with limits $3,861 a month | 78th of 360, with limits $4,450 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 | 64th cheapest of 364 $1,335 a month | 108th of 364, with limits $364 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 CodeSandbox SDK builds sandboxes from any Dockerfile and runs Docker inside, which Railway's sandbox docs do not mention; boat adds /dev/kvm for Android and VM builds. | 92nd cheapest of 377 $860 a month | 113th cheapest of 377 $1,210 a month | 4th cheapest of 377 $86 a month |
| 24/7 dev boxes 1 machine 24/7 · 4 vCPU / 8 GB CodeSandbox SDK hibernates after at most one day idle, and Railway's Cloud Agents keep a disk but are early access and fixed at 4 vCPU / 4 GB on Pro. | 310th of 368, with limits $240 a month | 66th cheapest of 368 $89 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 Both CodeSandbox SDK and Railway are headless, with no desktop to stream or drive, while boat streams a 60fps desktop with Chromium. | 206th of 369, with limits $691 a month | 77th of 369, with limits $103 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 | 251st of 367, with limits $443 a month | 53rd of 367, with limits $93 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 | 281st of 346, with limits $508 a month | 60th cheapest of 346 $570 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 | 193rd of 338, with limits $7,390 a month | 109th of 338, with limits $2,988 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 | 240th of 360, with limits $326 a month | 43rd of 360, with limits $574 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 | Can't run it | Can't run it | Can't run it |
| macOS agents 5 at once · 4 vCPU / 8 GB · 1,000 sessions of 20 min a month | Can't run it | Can't run it | Can't run it |
Key features
| Feature | CodeSandbox SDK | Railway | boat |
|---|---|---|---|
| Isolation | Firecracker microVM with its own kernel | Sandboxes are isolated Linux VMs; app services are containers | Full VM with its own kernel on dedicated AMD Ryzen 9 9950X hosts |
| When the sandbox goes idle | Hibernates with a memory snapshot and costs nothing while asleep | Destroyed after the idle timeout (30 minutes by default); files survive only in checkpoints you take | You stop it; the disk is saved every minute and on stop, and a stopped sandbox costs nothing |
| Wake on request | Yes; an HTTP request to a host wakes it with its processes still running | No; a destroyed sandbox is booted again from a checkpoint | No; a stopped sandbox is started by API |
| Fork | Fork a hibernated sandbox from its snapshot, or a running one sharing its memory | Fork a running sandbox's filesystem; boot new ones from disk checkpoints (no memory) | Fork a running sandbox with its disk; named snapshots to start new ones |
| Docker and nested virtualization | Docker and root, built from any Dockerfile; nested virtualization not documented | Root shell on Ubuntu; the sandbox docs do not mention Docker or /dev/kvm | Docker, root, systemd and /dev/kvm on every machine |
| Shell access | Terminals, commands and files through the SDK; no SSH | SSH and port forwarding, plus exec | SSH, plus exec and files over the API |
| Reaching the sandbox | HTTPS host per port, public by default, signed tokens for private hosts; no raw TCP or public IP | Up to 10 public HTTPS domains, set only at creation | HTTPS URLs for up to 50 ports, token-protected by default; raw TCP; a dedicated IPv6 or IPv4 |
| Coding agents | None built in; run your own through the command API | Claude Code, Codex, OpenCode and Pi preinstalled; you run them headless through exec | Claude Code, Codex and others preinstalled, with a prompt, steer and events API |
| Desktop and computer use | No desktop; a headless Chromium template | Headless: terminal, exec and SSH only | Linux desktop streamed at 60fps, Chromium and computer-use tools |
| Keeping API keys out of the sandbox | Secrets passed in as environment variables | Secrets set as environment variables, or signed in and saved in a checkpoint | Credentials proxy for model providers and any HTTPS API; switch a credential to another account when credits run out |
| Apps and databases next to the sandbox | Sandboxes only | Deploy Postgres, Redis and services in the same project; a sandbox can join their private network | No hosted databases or app services; host your own inside a sandbox |
| Biggest machine | 16 cores / 32 GB on Scale, up to 64 cores / 128 GB on Enterprise | 8 vCPU / 8 GB on Hobby, 32 vCPU / 32 GB on Pro | 8 vCPU / 16 GB on the $20 plan, 16 vCPU / 32 GB from $100 |
| Sandboxes at once | 10 on Build, 250 on Scale, more on Enterprise | 50 per environment on Hobby, 100 on Pro; Enterprise can ask for more | 100 to 2,000 by plan |
| Regions | No region to pick; a country hint steers scheduling but is not a guarantee | US West, US East, Amsterdam and Singapore; new sandboxes start in US West unless you pick one | EU only: Germany, Finland, France |
Every feature Battleships tracks (43)
| Feature | CodeSandbox SDK | Railway | boat |
|---|---|---|---|
| Full VM (own kernel) | Yes | Yes | Yes |
| Docker inside | Yes | Not published | Yes |
| Nested virtualization | No | No | Yes |
| Root | Yes | Yes | Yes |
| Systemd | Not published | Not published | Yes |
| Desktop GUI | No | No | Yes |
| Browser | No | Yes | Yes |
| Computer-use API | No | No | Yes |
| SSH | No | Yes | Yes |
| Persistent disk | Yes | Yes | Yes |
| Pause/resume | Yes | Yes | Yes |
| Automatic snapshots | Yes | No | Yes |
| Fork/clone | Yes | Yes | Yes |
| Live fork (no pause) | Yes | Yes | Yes |
| Memory fork | Yes | No | No |
| Custom image (Docker or snapshot) | Yes | Yes | Yes |
| ≥24 h sessions | Yes | Yes | Yes |
| Idle auto-stop | Yes | Yes | No |
| Wake on request | Yes | No | No |
| HTTPS preview URLs | Yes | Yes | Yes |
| Raw TCP inbound | No | No | Yes |
| Public IPv4 | No | No | No |
| Egress allowlist | No | No | No |
| Secret proxy | No | No | Yes |
| Secret proxy for any API | No | No | Yes |
| Preinstalled agents | No | Yes | Yes |
| Agent harness API | No | Yes | Yes |
| MCP server | No | Yes | No |
| GPU | No | No | No |
| Windows | No | No | No |
| Arm64 | No | No | No |
| Self-hosting | No | No | No |
| BYOC | No | Yes | No |
| Open source | No | No | No |
| Scoped API keys | Not published | Not published | Yes |
| Spend limits | Not published | Yes | Yes |
| Usage per sandbox (API) | No | No | Yes |
| Audit logs | Not published | Yes | No |
| SSO | Yes | Yes | No |
| SOC 2 | Yes | Yes | No |
| HIPAA | No | Yes | No |
| EU data residency | No | Yes | Yes |
| Zero data retention | Not published | Not published | Yes |
Performance
Neither CodeSandbox SDK nor Railway has a comparable CPU measurement, so we cannot say which of the two is faster. boat did 26.69 runs per second on the StarSling hpc-sandbox-benchmarks Node.js test at 4 vCPU / 8 GB, on dedicated AMD Ryzen 9 9950X hosts.
Node.js build-and-test loop at 4 vCPU / 8 GB, higher is better. Measured with the open hpc-sandbox-benchmarks suite. CodeSandbox SDK and Railway have 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.
| Scenario | CodeSandbox SDK, a month | Railway, a month | boat, 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 | $193 · Scale | $16 · Hobby · with limits | $20 · $20/mo |
| One agent that never stops 4 vCPU / 8 GB, 50 GB disk, running 24/7 all month | $341 · Scale | $70 · Hobby · with limits | $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,500 · Scale | $739 · Hobby · with limits | $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 | $815 · Scale · with limits | $223 · Pro · 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 | $1,632 · Scale · with limits | $781 · Pro · with limits | $2,000 · $2000/mo · with limits |
CodeSandbox SDK: You buy VM credits and each size burns a fixed number per hour, billed per started minute while the VM runs, including idle time before it hibernates. Scale adds a $170 monthly platform fee that is not usage credit, and a hibernated VM costs nothing.
Railway: Railway bills sandboxes per second for CPU actually used and memory in use, plus egress, and memory keeps billing while a sandbox waits until it is destroyed. The Hobby ($5) and Pro ($20) fees count toward usage, and sandbox disk has no published price, so our bills leave it out.
Railway: Plans start at $20 a month, and the whole fee is usage credit spent per second on running sandboxes. A stopped sandbox costs nothing and keeps its disk.
Limits in those scenarios
CodeSandbox SDK's Scale plan caps at 250 VMs at once, and Railway at 100 sandboxes per environment on Pro, so 300 user sandboxes or 1,000 jobs at once fit neither without Enterprise or several environments. CodeSandbox SDK gives each VM a 20 GB disk with no published price for more or for egress, and Railway is marked a different kind of product with no sandbox disk price, so its bills count CPU and memory only. An always-on agent on Railway also needs the idle timeout set to 0, or it is destroyed after 30 minutes. boat queues the 1,000-job burst above 90 starts a minute.
| Scenario | CodeSandbox SDK | Railway | boat |
|---|---|---|---|
| One coding agent, workdays |
|
| None that bite |
| One agent that never stops |
|
| None that bite |
| 50 agents in parallel |
|
| None that bite |
| Sandboxes for your users |
|
| None that bite |
| 1,000 short jobs at once |
|
|
|
Which one should you use?
Use CodeSandbox SDK when
your previews or code runs 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.
- Sleeps with its memory, wakes on a request. For previews and code runs used in bursts: an idle VM hibernates for free and an HTTP request wakes it with processes running.
- Forks that share memory. For rollouts or test variants: fork a running VM while it shares memory, so each copy starts from the same warm state.
- Docker from any Dockerfile. For teams with existing images: build a sandbox from any Dockerfile and run Docker inside it, as the docs describe.
Use Railway when
your app and databases already live on Railway and you want short-lived sandboxes on the same private network, or you need US or Asia regions.
- Next to your apps and databases. For apps already on Railway: a sandbox can join the same private network as your Postgres, Redis and services.
- Regions in the US, Europe and Asia. For users in the US or Asia: pick California, Virginia, Amsterdam or Singapore per sandbox.
- SSH and coding agents in the image. For quick agent runs: SSH in, and Claude Code, Codex, OpenCode and Pi are already installed.
Where boat fits
Both CodeSandbox SDK and Railway give you a headless Linux VM that you wire up yourself. If your agents work for hours with Docker, emulators, a browser and servers other people reach, boat gives each one a full machine with the agent and its keys already set up.
A whole machine with KVM
CodeSandbox SDK has no SSH and no documented nested virtualization, and Railway's sandbox docs do not mention Docker or /dev/kvm. On either, Android emulators and VM-based tests may not start; boat has SSH, systemd, Docker and /dev/kvm.
Agents you drive from outside, keys kept out
On CodeSandbox SDK you build the agent harness yourself, and on Railway you run agents through exec and parse their output. Both put API keys inside the VM as environment variables; boat keeps them in a credentials proxy.
A desktop and hosting beyond HTTPS
Both are headless, so computer-use agents have no screen. CodeSandbox SDK hosts are HTTPS only, and Railway gives 10 domains set at creation. boat streams a 60fps desktop and serves 50 ports plus raw TCP.
Use boat when your agents work for hours or days: a full VM that keeps its disk, with Docker, /dev/kvm, a desktop, and coding agents you drive by API while their keys stay outside. Compare it one to one: boat vs CodeSandbox SDK and boat vs Railway.
Questions people ask
Is CodeSandbox SDK cheaper than Railway?
In our scenarios Railway's bills are lower every time: one agent running all month is $70 on Railway and $341 on CodeSandbox SDK, and 50 agents in parallel are $739 against $2,500. Railway's numbers leave out disk, which it does not price. boat comes to $26 and $317 for the same two jobs.
Which is faster, CodeSandbox SDK or Railway?
We have no comparable CPU measurement for either, so we cannot say. boat did 26.69 runs per second on the StarSling Node.js benchmark at 4 vCPU / 8 GB.
What happens when a sandbox goes idle?
CodeSandbox SDK hibernates it with a memory snapshot, and it resumes with its processes still running. Railway destroys it after the idle timeout, 30 minutes by default, and only your checkpoints survive. boat stops it and keeps its disk, saved every minute.
Can CodeSandbox SDK and Railway run Docker?
CodeSandbox SDK runs Docker inside and builds sandboxes from any Dockerfile. Railway's sandbox docs do not mention Docker. boat has Docker, systemd and /dev/kvm on every machine.
Can I SSH into them?
Railway sandboxes support SSH and port forwarding. CodeSandbox SDK connects only through its SDK, Node and browser clients, with no SSH. Every boat sandbox has SSH as well as an exec and files API.
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.
Try boat
Install the CLI, then run boat new.
7-day free trial
More comparisons
- boat vs CodeSandbox SDK
- boat vs Railway
- E2B vs CodeSandbox SDK
- Daytona vs CodeSandbox SDK
- Modal vs CodeSandbox SDK
- Vercel Sandbox vs CodeSandbox SDK
- Cloudflare Sandbox vs CodeSandbox SDK
- Blaxel vs CodeSandbox SDK
- Runloop vs CodeSandbox SDK
- Tensorlake vs CodeSandbox SDK
- Morph Cloud vs CodeSandbox SDK
- CodeSandbox SDK vs Northflank