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.

Self-hosting
Not offered

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 workloadCodeSandbox SDK: price rankRailway: price rankboat: 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 itCan'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

FeatureCodeSandbox SDKRailwayboat
IsolationFirecracker microVM with its own kernelSandboxes are isolated Linux VMs; app services are containersFull VM with its own kernel on dedicated AMD Ryzen 9 9950X hosts
When the sandbox goes idleHibernates with a memory snapshot and costs nothing while asleepDestroyed after the idle timeout (30 minutes by default); files survive only in checkpoints you takeYou stop it; the disk is saved every minute and on stop, and a stopped sandbox costs nothing
Wake on requestYes; an HTTP request to a host wakes it with its processes still runningNo; a destroyed sandbox is booted again from a checkpointNo; a stopped sandbox is started by API
ForkFork a hibernated sandbox from its snapshot, or a running one sharing its memoryFork 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 virtualizationDocker and root, built from any Dockerfile; nested virtualization not documentedRoot shell on Ubuntu; the sandbox docs do not mention Docker or /dev/kvmDocker, root, systemd and /dev/kvm on every machine
Shell accessTerminals, commands and files through the SDK; no SSHSSH and port forwarding, plus execSSH, plus exec and files over the API
Reaching the sandboxHTTPS host per port, public by default, signed tokens for private hosts; no raw TCP or public IPUp to 10 public HTTPS domains, set only at creationHTTPS URLs for up to 50 ports, token-protected by default; raw TCP; a dedicated IPv6 or IPv4
Coding agentsNone built in; run your own through the command APIClaude Code, Codex, OpenCode and Pi preinstalled; you run them headless through execClaude Code, Codex and others preinstalled, with a prompt, steer and events API
Desktop and computer useNo desktop; a headless Chromium templateHeadless: terminal, exec and SSH onlyLinux desktop streamed at 60fps, Chromium and computer-use tools
Keeping API keys out of the sandboxSecrets passed in as environment variablesSecrets set as environment variables, or signed in and saved in a checkpointCredentials proxy for model providers and any HTTPS API; switch a credential to another account when credits run out
Apps and databases next to the sandboxSandboxes onlyDeploy Postgres, Redis and services in the same project; a sandbox can join their private networkNo hosted databases or app services; host your own inside a sandbox
Biggest machine16 cores / 32 GB on Scale, up to 64 cores / 128 GB on Enterprise8 vCPU / 8 GB on Hobby, 32 vCPU / 32 GB on Pro8 vCPU / 16 GB on the $20 plan, 16 vCPU / 32 GB from $100
Sandboxes at once10 on Build, 250 on Scale, more on Enterprise50 per environment on Hobby, 100 on Pro; Enterprise can ask for more100 to 2,000 by plan
RegionsNo region to pick; a country hint steers scheduling but is not a guaranteeUS West, US East, Amsterdam and Singapore; new sandboxes start in US West unless you pick oneEU only: Germany, Finland, France
Every feature Battleships tracks (43)
FeatureCodeSandbox SDKRailwayboat
Full VM (own kernel)YesYesYes
Docker insideYesNot publishedYes
Nested virtualizationNoNoYes
RootYesYesYes
SystemdNot publishedNot publishedYes
Desktop GUINoNoYes
BrowserNoYesYes
Computer-use APINoNoYes
SSHNoYesYes
Persistent diskYesYesYes
Pause/resumeYesYesYes
Automatic snapshotsYesNoYes
Fork/cloneYesYesYes
Live fork (no pause)YesYesYes
Memory forkYesNoNo
Custom image (Docker or snapshot)YesYesYes
≥24 h sessionsYesYesYes
Idle auto-stopYesYesNo
Wake on requestYesNoNo
HTTPS preview URLsYesYesYes
Raw TCP inboundNoNoYes
Public IPv4NoNoNo
Egress allowlistNoNoNo
Secret proxyNoNoYes
Secret proxy for any APINoNoYes
Preinstalled agentsNoYesYes
Agent harness APINoYesYes
MCP serverNoYesNo
GPUNoNoNo
WindowsNoNoNo
Arm64NoNoNo
Self-hostingNoNoNo
BYOCNoYesNo
Open sourceNoNoNo
Scoped API keysNot publishedNot publishedYes
Spend limitsNot publishedYesYes
Usage per sandbox (API)NoNoYes
Audit logsNot publishedYesNo
SSOYesYesNo
SOC 2YesYesNo
HIPAANoYesNo
EU data residencyNoYesYes
Zero data retentionNot publishedNot publishedYes

Performance

CodeSandbox SDKNot measured
RailwayNot measured
boat26.69 runs/s

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.

ScenarioCodeSandbox SDK, a monthRailway, a monthboat, 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.

ScenarioCodeSandbox SDKRailwayboat
One coding agent, workdays
  • disk beyond 20 GiB: price unknown
  • egress price not published
  • different kind of product: app platform
  • disk beyond 0 GiB: price unknown
None that bite
One agent that never stops
  • disk beyond 20 GiB: price unknown
  • egress price not published
  • different kind of product: app platform
  • disk beyond 0 GiB: price unknown
None that bite
50 agents in parallel
  • egress price not published
  • not confirmed: Docker inside
  • different kind of product: app platform
  • disk beyond 0 GiB: price unknown
None that bite
Sandboxes for your users
  • Scale: max 250 concurrent
  • egress price not published
  • Pro: max 100 concurrent
  • different kind of product: app platform
  • disk beyond 0 GiB: price unknown
None that bite
1,000 short jobs at once
  • Scale: max 250 concurrent
  • egress price not published
  • Pro: max 100 concurrent
  • different kind of product: app platform
  • disk beyond 0 GiB: price unknown
  • 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 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