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 that added sandbox VMs. Railway destroys a sandbox at its idle timeout, unless you save a checkpoint first. Its sandboxes 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 call it the deprecated 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. It 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 that you create from the CLI or a TypeScript SDK, run commands in and destroy. It also added Cloud Agents: a personal VM for a coding agent that keeps its disk and sleeps or wakes. Cloud Agents are in Priority Boarding, and breaking changes may occur. Railway suits teams that already host on Railway and want sandboxes 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. “32nd cheapest of 365” means 31 of the other 364 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. A Railway sandbox ends at the idle timeout, so you keep work with checkpoints you take, or use a Cloud Agent, which keeps its disk. boat saves its disk every minute and documents Docker and /dev/kvm. | 32nd cheapest of 365 $3,731 a month | 28th cheapest of 365 $1,481 a month | 5th cheapest of 365 $634 a month |
| Always-on AI employees 50 machines 24/7 · 2 vCPU / 4 GB Both fit an always-on assistant. CodeSandbox SDK has no hard session cap. On Railway you set the idle timeout to 0 or use a Cloud Agent, and memory bills the whole time. On boat, turn auto-stop off on a paid plan (default 1 hour). | 50th cheapest of 361 $4,811 a month | 21st cheapest of 361 $3,977 a month | 6th cheapest of 361 $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. Railway bills for CPU used and ends the sandbox when the job ends, with no published start limit. boat's start limits make it a compromise here. | 54th cheapest of 336 $642 a month | 42nd cheapest of 336 $413 a month | 189th of 336, 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 allows 300 at once on its $100 plan. | 140th of 349, with limits $1,707 a month | 46th of 349, with limits $290 a month | 3rd cheapest of 349 $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 a running sandbox's filesystem. A boat fork also copies the disk only. | 341st of 349, with limits $3,861 a month | 84th of 349, with limits $4,450 a month | 39th of 349, with limits $2,000 a month |
| Agent evals 250 at once · 4 vCPU / 8 GB · 15,000 sessions of 20 min a month | 77th cheapest of 359 $1,335 a month | 113th of 359, with limits $364 a month | 10th cheapest of 359 $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. Railway's sandbox docs do not mention Docker; you install and verify it yourself. boat adds /dev/kvm for Android and VM builds. | 96th cheapest of 374 $860 a month | 116th cheapest of 374 $1,210 a month | 2nd cheapest of 374 $86 a month |
| 24/7 dev boxes 1 machine 24/7 · 4 vCPU / 8 GB CodeSandbox SDK hibernates after an idle timeout of up to one day and documents no SSH. Railway's Cloud Agents keep a disk and sleep or wake, but are in Priority Boarding and fixed at 4 vCPU / 4 GB on Pro. A boat dev machine has SSH and runs at any size up to your plan's maximum. | 316th of 371, with limits $240 a month | 69th cheapest of 371 $89 a month | 19th cheapest of 371 $26 a month |
| Computer-use agents 50 at once · 4 vCPU / 8 GB · 20,000 sessions of 15 min a month Neither includes a desktop. On CodeSandbox SDK you add a VNC desktop to your Dockerfile; on Railway you add Xvfb and noVNC with the template builder. boat streams a 60 fps desktop with Chrome, built in. | 54th cheapest of 367 $1,236 a month | 47th cheapest of 367 $407 a month | 7th cheapest of 367 $200 a month |
| Browser-use agents 50 at once · 2 vCPU / 4 GB · 30,000 sessions of 10 min a month | 125th of 356, with limits $741 a month | 53rd of 356, with limits $93 a month | 7th cheapest of 356 $200 a month |
| Scraping & bots (startup scale) 50 at once · 1 vCPU / 2 GB · 100,000 sessions of 3 min a month | 119th cheapest of 343 $871 a month | 65th cheapest of 343 $570 a month | 6th cheapest of 343 $90 a month |
| Mass scraping & bots (undetectable) 1,000 at once · 1 vCPU / 2 GB · 3,000,000 sessions of 2 min a month | 194th of 327, with limits $7,390 a month | 111th of 327, with limits $2,988 a month | 73rd of 327, with limits $1,800 a month |
| Parallel red teaming 200 at once · 2 vCPU / 4 GB · 5,000 sessions of 30 min a month | 29th cheapest of 351 $505 a month | 71st of 351, with limits $574 a month | 3rd cheapest of 351 $200 a month |
| GPU eval jobs 10 at once · 8 vCPU / 32 GB · 500 sessions of 30 min a month | Not ranked: misses a requirement | Not ranked: misses a requirement | Not ranked: misses a requirement |
| macOS agents 5 at once · 4 vCPU / 8 GB · 1,000 sessions of 20 min a month | Not ranked: misses a requirement | Not ranked: misses a requirement | Not ranked: misses a requirement |
Key features
| Feature | CodeSandbox SDK | Railway | boat |
|---|---|---|---|
| Isolation | Firecracker microVM with its own kernel | Sandboxes and Cloud Agents are isolated Linux VMs; app services are containers | Full VM with its own kernel, on hosts dedicated to boat (AMD Ryzen 7 9700X and Ryzen 9 9950X); vCPUs are shared |
| When the sandbox goes idle | Hibernates with a memory snapshot and has no VM charge while asleep | Destroyed after the idle timeout (30 minutes by default, or 0 for never); files survive in checkpoints you take; Cloud Agents sleep and keep their disk | Auto-stop after 1 hour by default (up to 30 days, or off on paid plans); disk saved every minute and at stop, kept at least 14 days; memory is not saved |
| 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; you start a stopped sandbox by API |
| Fork | Fork a hibernated sandbox from its memory snapshot, or a running one that shares memory with its parent | Fork a running sandbox's filesystem; named disk checkpoints boot new ones (no memory) | Fork a running sandbox from its last 1-minute disk snapshot; saved snapshots start new ones (no memory) |
| Docker and nested virtualization | Docker and root, built from any Dockerfile; nested virtualization not documented | Root shell on an Ubuntu VM; Docker and /dev/kvm are not documented, so you install and verify them yourself | Docker, root, systemd and /dev/kvm documented on every sandbox |
| Shell access | Terminals, commands and files through the SDK; SSH is not documented | 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 sandboxes; raw TCP is not documented | Up to 10 public HTTPS domains, set only at creation, with no built-in auth | Up to 50 HTTPS URLs, token-gated by default; raw ports on the public IPv6 address (some sandboxes also have IPv4); the IP changes at each resume |
| Coding agents | You install your own agent in the template and run it through the commands API | Claude Code, Codex, OpenCode and Pi installed, run through exec; Cloud Agents keep terminal sessions you reattach to | Seven harnesses installed, including Claude Code and Codex, with a prompt, steer and events API |
| Desktop and computer use | No built-in desktop; a headless Chromium template, and you can install a VNC desktop in your own Dockerfile | No desktop included; you can add Xvfb and noVNC with the template builder and publish the port | Built-in desktop and Chrome streamed at 1920x1080, 60 fps, with computer-use tools; no GPU |
| Keeping API keys out of the sandbox | Secrets passed in as environment variables; no credentials proxy documented | Secrets set as environment variables, or signed in and saved in a checkpoint | Optional credentials proxy ($1 a day while on, plus $1 per 1,000 requests): real keys of supported model providers stay outside; other secrets still enter the sandbox |
| 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; on Pro up to 32 vCPU / 32 GB per the docs; disk size not published | 8 vCPU / 16 GB on the $20 plan, 16 vCPU / 32 GB from $100; disk fixed per size, up to 251 GB |
| Sandboxes at once | 250 on Scale, more on Enterprise | Per environment: 10 on Free, 50 on Hobby, 100 on Pro; Enterprise can ask for more; no published start limit | 100 on $20 up to 2,000 on $2,000; starts limited per minute, hour and day |
| Regions | A country hint steers scheduling, but placement is not guaranteed | US West, US East, Amsterdam and Singapore; new sandboxes start in US West unless you pick one | Germany, Finland and France; you cannot pick a region; no US or Asia region |
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 documented way | Not published | Yes |
| Root | Yes | Yes | Yes |
| Systemd | Not published | Not published | Yes |
| Desktop GUI | With your own setup | With your own setup | Yes |
| Browser | With your own setup | Yes | Yes |
| Computer-use API | No documented way | No documented way | Yes |
| SSH | No documented way | Yes | Yes |
| Persistent disk | Yes | Yes | Yes |
| Pause/resume | Yes | Yes | Yes |
| Automatic snapshots | Yes | No documented way | Yes |
| Fork/clone | Yes | Yes | Yes |
| Live fork (no pause) | Yes | Yes | Yes |
| Memory fork | Yes | No documented way | No documented way |
| Custom image (Docker or snapshot) | Yes | Yes | Yes |
| ≥24 h sessions | Yes | Yes | Yes |
| Idle auto-stop | Yes | Yes | No documented way |
| Wake on request | Yes | No documented way | No documented way |
| HTTPS preview URLs | Yes | Yes | Yes |
| Raw TCP inbound | No documented way | No documented way | Yes |
| Public IPv4 | No documented way | No documented way | No documented way |
| Egress allowlist | No documented way | No documented way | No documented way |
| Secret proxy | No documented way | No documented way | Yes |
| Secret proxy for any API | No documented way | No documented way | Yes |
| Preinstalled agents | No documented way | Yes | Yes |
| Agent harness API | No documented way | Yes | Yes |
| MCP server | No documented way | Yes | No documented way |
| GPU | No documented way | No documented way | No documented way |
| Windows | No documented way | No documented way | No documented way |
| Arm64 | No documented way | No documented way | No documented way |
| Self-hosting | No documented way | No documented way | No documented way |
| BYOC | No documented way | Yes | No documented way |
| Open source | No documented way | No documented way | No documented way |
| Scoped API keys | Not published | Not published | Yes |
| Spend limits | Not published | Yes | Yes |
| Usage per sandbox (API) | No documented way | No documented way | Yes |
| Audit logs | Not published | Yes | No documented way |
| SSO | Yes | Yes | No documented way |
| SOC 2 | Yes | Yes | No documented way |
| HIPAA | No documented way | Yes | No documented way |
| EU data residency | No documented way | Yes | No documented way |
| Zero data retention | Not published | Not published | Yes |
Performance
Neither CodeSandbox SDK nor Railway is in the public CPU benchmarks we use, so we cannot say which is faster. In StarSling's run of 3 October 2026 (run 37073680030), boat did 28.06 runs/s on the V8 Web Tooling Benchmark at 4 vCPU / 8 GB, second of 15. Every boat sandbox in this run ran on an AMD Ryzen 9 9950X host. boat also places some sandboxes on AMD Ryzen 7 9700X hosts, which this run did not measure. For start time, ComputeSDK measured CodeSandbox SDK at its default size: 11.76 s median with 100 starts at once (6 November 2026) and 2.33 s one at a time in its latest published run. Railway and boat are not in ComputeSDK.
V8 Web Tooling Benchmark at a 4 vCPU / 8 GB target, runs per second, higher is better. Source: StarSling's run of 3 October 2026 (run 37073680030), median of 5 sandboxes. Providers ran on different hardware in different regions. StarSling gives a shared rank when the run cannot separate two providers. Every boat sandbox in this run ran on an AMD Ryzen 9 9950X host. boat also places some sandboxes on AMD Ryzen 7 9700X hosts, which this run did not measure. CodeSandbox SDK and Railway are not in the public benchmarks we use, so we cannot say which is faster.
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. Start limits, per-start fees and plan minimums are in the price, boat's included.
| 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 | $8,800 · $2000/mo · with limits |
CodeSandbox SDK: You buy VM credits at $0.01486 each, and each size burns a fixed number per hour: 20 for a 4 vCPU / 8 GB VM, about $0.30. Billing is per started minute while the VM runs, including idle time before it hibernates. A hibernated VM has no VM charge. Larger teams pay a $170 monthly Scale platform fee, which is not usage credit. Prices as checked on 28 September 2026; CodeSandbox's pricing pages blocked our automated check on 8 November 2026.
Railway: Railway bills sandboxes per second at about $50 per vCPU-month on CPU actually used and $50 per GB-month on memory in use, plus $0.05 per GB out. Memory keeps billing while a sandbox waits, until it is destroyed. Plans: Free ($0 with $1 of usage a month), Hobby ($5) and Pro ($20); the Hobby and Pro fees count toward usage. Railway does not publish a price for sandbox disk or checkpoints, so our bills leave disk out.
Railway: Plans cost $20, $100, $500 or $2,000 a month, and the whole plan price comes back as VM time for that month. A 4 vCPU / 8 GB sandbox costs $0.036 an hour, billed per second while it runs, busy or idle. The $20 plan includes 200 starts a day; each extra start costs $0.03 to $0.07. A stopped sandbox has no compute charge and keeps its disk for at least 14 days. Saved snapshots above the included count and the credentials proxy, while it is on, still charge.
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. 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 needs the idle timeout set to 0. boat does not fit the 1,000-job burst: the $2,000 plan includes 90 starts a minute and 2,400 a day, extra starts are paid, and starts above 270 a minute fail with 429. Below about $20 of use a month, Railway's $0 and $5 plans cost less than boat.
| Scenario | CodeSandbox SDK | Railway | boat |
|---|---|---|---|
| One coding agent, workdays |
|
| None for this scenario |
| One agent that never stops |
|
| None for this scenario |
| 50 agents in parallel |
|
| None for this scenario |
| Sandboxes for your users |
|
| None for this scenario |
| 1,000 short jobs at once |
|
|
|
Which one should you use?
Use CodeSandbox SDK when
your previews or code runs sleep between visits and wake on the next HTTP request with their memory intact, and you accept that Together calls this SDK deprecated.
- Sleeps with its memory, wakes on a request. For previews and code runs used in bursts: an idle VM hibernates with no VM charge, 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 sandboxes on the same private network, you need US or Asia regions, or you run many short jobs that bill for CPU used.
- 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, agents in the image, small bills. For quick agent runs: SSH in, with Claude Code, Codex, OpenCode and Pi installed, billed for CPU used, from a $0 or $5 plan.
Where boat fits
If your agents work for hours with Docker, emulators, a browser and servers other people reach, look at boat. Each agent gets a full VM that saves its disk every minute, with the agents and a desktop installed. boat runs only in Germany, Finland and France, and limits starts by plan.
A whole machine with KVM
CodeSandbox SDK documents no SSH and no nested virtualization. Railway's sandbox docs do not mention Docker or /dev/kvm. On either, Android emulators and VM-based tests are not documented. boat has SSH, systemd, Docker and /dev/kvm.
Agents you drive from outside
On CodeSandbox SDK you build the agent harness yourself. On Railway you run agents through exec and parse their output. Both put API keys inside the VM as environment variables. boat has a prompt, steer and events API, and an optional paid credentials proxy keeps model keys outside.
A desktop and hosting beyond HTTPS
Neither includes a desktop; on both you install VNC yourself. CodeSandbox SDK hosts are HTTPS only, and Railway gives 10 domains set at creation. boat streams a 60 fps desktop and serves up to 50 HTTPS URLs plus raw ports on IPv6.
Use boat when your agents work for hours or days: a full VM that stops and keeps its disk, with Docker, /dev/kvm and a desktop documented on every sandbox, and coding agents you drive by API. Compare it one to one: boat vs CodeSandbox SDK and boat vs Railway.
boat's own limits
- Plans start at $20 a month. The plan price comes back as VM time for that month. Unused time does not carry over. Source
- Starts (create, fork, resume): the $20 plan includes 12 a minute, 60 an hour and 200 a day. The $2,000 plan includes 90 a minute, 600 an hour and 2,400 a day. Extra starts cost $0.03 to $0.07. A start fails with 429 above 3 times the included starts per minute, or 6 times per hour or per day. Source
- A stopped sandbox has no compute charge. boat keeps its disk for at least 14 days. A saved snapshot keeps it longer; extra saved snapshots and the AI credentials proxy are paid. Source
- Auto-stop defaults to 1 hour. You can turn it off on a paid plan. The trial allows 2 hours at most. Source
- boat saves the disk every minute and at each stop. Memory, running programs and /tmp are not saved: a resume is like a reboot. A machine failure loses writes after the last good snapshot. Source
- Machines run in Germany, Finland and France only. Snapshot copies can be stored outside the EU. Source
- Public IPv6 and outbound IPv4. No dedicated IPv4. The IP changes at each resume. Source
- Hosts are AMD Ryzen 7 9700X and Ryzen 9 9950X. vCPUs are shared. No GPU. You cannot boot your own Docker image. Source
Questions people ask
Is CodeSandbox SDK cheaper than Railway?
In our scenarios Railway's bills are lower every time. One agent on workdays is $16 on Railway and $193 on CodeSandbox SDK. One agent running all month is $70 against $341, and 50 agents in parallel are $739 against $2,500. Railway's numbers leave out disk, which it does not price. boat comes to $20, $26 and $317 for the same three.
Which is faster, CodeSandbox SDK or Railway?
Neither is in the public CPU benchmarks we use, so we cannot say. In StarSling's run of 3 October 2026, boat did 28.06 runs/s on the V8 Web Tooling Benchmark at 4 vCPU / 8 GB, on an AMD Ryzen 9 9950X host. boat also places some sandboxes on slower hosts.
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 your checkpoints boot a new one; a Cloud Agent sleeps and keeps its disk. boat stops it after 1 hour by default and keeps its disk, saved every minute, but not its memory.
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; you install and verify it yourself. boat has Docker, systemd and /dev/kvm on every sandbox.
Can I SSH into them?
Railway sandboxes support SSH and port forwarding. CodeSandbox SDK connects through its SDK, Node and browser clients; SSH is not documented. 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 this SDK deprecated and name together-sandbox as its successor. The last SDK release was 2.4.2 in December 2025. 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