Cloudflare Sandbox vs OpenAI Containers
Cloudflare Sandbox gives you a container from your own image, driven by your own Worker, that sleeps when idle and wakes on the next request. OpenAI Containers are a tool inside OpenAI's model API: the model runs Python or shell commands on a fixed Debian 12 image, and the box expires after 20 minutes without use.
The companies and products
Cloudflare Sandbox
Cloudflare Sandbox SDK runs untrusted or AI-generated code in Linux containers on Cloudflare's network, driven from a Cloudflare Worker.
Each sandbox is a Cloudflare Container backed by a Durable Object, and each container runs in its own Firecracker microVM with its own kernel and network. You build a linux/amd64 image, pick an instance type of up to 4 vCPU and 12 GiB, and reach the sandbox through your own Worker. It suits teams already on Workers who want short-lived sandboxes that sleep when idle; for code that only calls known methods, Cloudflare also offers Dynamic Workers, which run JavaScript in V8 isolates.
- Largest instance
- 4 vCPU, 12 GiB memory, 20 GB disk (defaults, can be raised)
- Account limits
- 1,500 vCPU, 6 TiB memory and 30 TB disk running at once
- Compliance
- Cloudflare holds a SOC 2 Type II report
OpenAI Containers
OpenAI Containers are the sandboxes OpenAI runs for its own model tools: Code Interpreter, Hosted Shell and the Agents API's hosted sandbox.
This is a different kind of product from boat: a tool inside OpenAI's model API, not a machine you rent. You create a container through the API or let a Responses call make one, and the model runs Python or shell commands in it on a fixed Debian 12 image without sudo, until it expires after 20 minutes without use. It is built for apps that already call OpenAI models and want them to run code, read files and make charts without running any servers.
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. “13th cheapest of 345” means 12 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 | Cloudflare Sandbox: price rank | OpenAI Containers: price rank | boat: price rank |
|---|---|---|---|
| Software factory 100 at once · 4 vCPU / 8 GB · 2,200 sessions of 8 h a month A coding agent that keeps a repo for days loses it on both: Cloudflare's disk resets after sleep and OpenAI discards data after 20 idle minutes, while boat keeps the disk. | 162nd of 367, with limits $1,543 a month | 356th of 367, with limits $17,371 a month | 3rd cheapest of 367 $634 a month |
| Always-on AI employees 50 machines 24/7 · 2 vCPU / 4 GB Always-on assistants need files and logins that stay; neither Cloudflare nor OpenAI keeps the disk on its own, and boat saves it every minute and on stop. | 207th of 366, with limits $2,188 a month | 341st of 366, with limits $13,140 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 are built for short code runs: Cloudflare bills CPU only while busy and wakes on request, while OpenAI runs the model's code inside the same API call with no machine to manage. | 13th cheapest of 345 $144 a month | 194th of 345, with limits $6,000 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 Cloudflare fits sandboxes for your users, with previews routed through your Worker; OpenAI containers have no inbound access, so your users cannot open anything they build, and boat adds HTTPS URLs on 50 ports. | 9th cheapest of 361 $731 a month | 361st of 361, with limits $3,780 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 | 144th of 360, with limits $9,428 a month | 191st of 360, with limits $30,000 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 | 45th cheapest of 364 $818 a month | 360th of 364, with limits $5,760 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 jobs that build images need Docker and open internet; Cloudflare runs Docker with iptables turned off and 20 GB of disk by default, and OpenAI documents no Docker or root. | 301st of 377, with limits $704 a month | 345th of 377, with limits $1,728 a month | 4th cheapest of 377 $86 a month |
| 24/7 dev boxes 1 machine 24/7 · 4 vCPU / 8 GB A dev box should keep its files when you log off; Cloudflare starts from a fresh disk after sleep, OpenAI has no SSH or persistent disk, and boat stops at no cost with its disk. | 70th cheapest of 368 $93 a month | 362nd of 368, with limits $1,051 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 OpenAI has a hosted browser for the Agents API computer_use tool, Cloudflare removed its built-in desktop, and boat streams a 60fps desktop you can embed. | 166th of 369, with limits $460 a month | 351st of 369, with limits $5,280 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 | 210th of 367, with limits $233 a month | 328th of 367, with limits $1,440 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 | 250th of 346, with limits $286 a month | 328th of 346, with limits $1,755 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 | 169th of 338, with limits $5,741 a month | 311th of 338, with limits $35,100 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 Red-team runs often need raw TCP and full root networking; Cloudflare containers cannot change iptables, OpenAI containers run without sudo, and boat has both. | 239th of 360, with limits $325 a month | 308th of 360, with limits $870 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 | Cloudflare Sandbox | OpenAI Containers | boat |
|---|---|---|---|
| What it is | A container from your image, driven from your own Cloudflare Worker | A sandbox tool the model uses inside OpenAI's API | A cloud VM you create, keep, stop and reach from outside |
| Isolation | Firecracker microVM per container, own kernel and network | A fully sandboxed virtual machine; hypervisor not named | Full VM with its own kernel on dedicated AMD Ryzen 9 9950X hosts |
| Machine size | Up to 4 vCPU / 12 GiB / 20 GB disk by default (can be raised) | 1, 4, 16 or 64 GB of memory; vCPU not published | 4 vCPU / 8 GB by default, up to 16 vCPU / 32 GB |
| Custom image | Any linux/amd64 container image you build | Fixed Debian 12 image; you upload files or skills into each container | Named snapshots of a set-up machine, reused as templates |
| Files between sessions | Fresh disk after sleep; snapshots (public beta, 30 days) or R2 backups when your code saves them | Data discarded when the container expires; no snapshots | Disk saved every minute and on stop; a stopped sandbox costs nothing |
| Lifetime | No fixed maximum runtime; sleeps after inactivity, host restarts can stop it | Expires after 20 minutes without use | No session cap on paid plans; you set the time to live |
| Root and Docker | docker:dind with iptables and IP forwarding turned off | Commands do not run with sudo; no Docker documented | Root, systemd, full Docker and /dev/kvm |
| Fork a running sandbox | No fork; restore a saved snapshot or backup into a new sandbox | No fork | Yes, without stopping it |
| Inbound traffic | HTTP and WebSocket previews routed through your Worker; no raw TCP | None; reached only through the API | SSH, HTTPS URLs for up to 50 ports, raw TCP |
| Outbound internet | Open by default; allowedHosts deny list and outbound handlers in Worker code | Code Interpreter and Hosted Shell: off until an admin sets an org domain allowlist | Open internet; no provider-side allowlist |
| Keeping keys out of the sandbox | Your outbound handler adds the token for any HTTP or HTTPS host | domain_secrets: a sidecar adds the real header, the model sees a placeholder | Managed proxy for model providers and any HTTPS API; switch a credential to another account |
| Coding agents | Run Claude Code, Codex, OpenCode or Pi in your image | Agents API (beta) drives a managed Codex harness, with steering and events | Claude Code, Codex, OpenCode and more preinstalled, with a prompt, steer and events API |
| Desktop and computer use | Built-in desktop removed in SDK 0.10.2; bring your own | Hosted browser for the Agents API computer_use tool | 60fps desktop and Chromium, computer-use API, embeddable stream |
| Regions | Several regions across Cloudflare's network | US or EU processing for Code Interpreter | EU only: Germany, Finland, France |
Every feature Battleships tracks (43)
| Feature | Cloudflare Sandbox | OpenAI Containers | boat |
|---|---|---|---|
| Full VM (own kernel) | Yes | Yes | Yes |
| Docker inside | Yes | No | Yes |
| Nested virtualization | No | No | Yes |
| Root | Yes | No | Yes |
| Systemd | Not published | Not published | Yes |
| Desktop GUI | No | Yes | Yes |
| Browser | No | Yes | Yes |
| Computer-use API | No | Yes | Yes |
| SSH | Yes | No | Yes |
| Persistent disk | No | No | Yes |
| Pause/resume | No | No | Yes |
| Automatic snapshots | No | No | Yes |
| Fork/clone | No | No | Yes |
| Live fork (no pause) | No | No | Yes |
| Memory fork | No | No | No |
| Custom image (Docker or snapshot) | Yes | No | Yes |
| ≥24 h sessions | Yes | Yes | Yes |
| Idle auto-stop | Yes | Yes | No |
| Wake on request | Yes | No | No |
| HTTPS preview URLs | Yes | No | Yes |
| Raw TCP inbound | No | No | Yes |
| Public IPv4 | No | No | No |
| Egress allowlist | Yes | Yes | No |
| Secret proxy | Yes | Yes | Yes |
| Secret proxy for any API | Yes | Yes | Yes |
| Preinstalled agents | Yes | No | Yes |
| Agent harness API | Yes | Yes | Yes |
| MCP server | No | No | No |
| GPU | No | No | No |
| Windows | No | No | No |
| Arm64 | No | No | No |
| Self-hosting | No | Yes | No |
| BYOC | No | No | No |
| Open source | Yes | No | No |
| Scoped API keys | Not published | Not published | Yes |
| Spend limits | No | Not published | Yes |
| Usage per sandbox (API) | Not published | No | Yes |
| Audit logs | Yes | Not published | No |
| SSO | Yes | Yes | No |
| SOC 2 | Yes | Yes | No |
| HIPAA | Yes | Yes | No |
| EU data residency | Yes | Yes | Yes |
| Zero data retention | Not published | Not published | Yes |
Performance
There is no comparable CPU measurement for either one: Cloudflare Sandbox and OpenAI Containers have no result on the hpc-sandbox-benchmarks Node.js build-and-test loop, and OpenAI does not publish the vCPU behind each container size. boat did 26.69 runs per second on that benchmark at 4 vCPU / 8 GB.
Node.js build-and-test loop at 4 vCPU / 8 GB, higher is better. Measured with the open hpc-sandbox-benchmarks suite. Cloudflare Sandbox and OpenAI Containers 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 | Cloudflare Sandbox, a month | OpenAI Containers, 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 | $39 · Workers Paid · with limits | $228 · API pay as you go · with limits | $20 · $20/mo |
| One agent that never stops 4 vCPU / 8 GB, 50 GB disk, running 24/7 all month | $148 · Workers Paid · with limits | $1,051 · API pay as you go · 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 | $1,660 · Workers Paid · with limits | $11,405 · API pay as you go · 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 | $476 · Workers Paid | $1,620 · API pay as you go · 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,889 · Workers Paid · with limits | $6,000 · API pay as you go · with limits | $2,000 · $2000/mo · with limits |
Cloudflare Sandbox: You need Workers Paid ($5 a month minimum). CPU is billed only while busy, memory and disk on the instance size you picked until the container sleeps, and 4 vCPU always comes with 12 GiB.
OpenAI Containers: Each container session is billed by the minute for the memory size you pick, with a 5-minute minimum, and model tokens are billed on top. There is no plan fee.
OpenAI Containers: You pick a monthly plan from $20, and all of it becomes usage credit spent per second on running sandboxes. A stopped sandbox costs nothing and keeps its disk.
Limits in those scenarios
Neither keeps 50 GB of files between days on its own, so the coding-agent scenarios do not fit either one as written. OpenAI also has no Docker, no open internet in Code Interpreter or Hosted Shell, and no published limit on how many containers run at once, so the 300 user sandboxes and the 1,000-job burst are unconfirmed. Cloudflare fits the user-sandboxes scenario, but an account runs 1,500 vCPU at once by default, short of the 2,000 the burst needs. On boat that burst runs into start limits: the $2,000 plan allows 600 starts an hour.
| Scenario | Cloudflare Sandbox | OpenAI Containers | 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 |
| None that bite |
| 1,000 short jobs at once |
|
|
|
Which one should you use?
Use Cloudflare Sandbox when
your app already runs on Workers and you want short sandboxes from your own image that sleep when idle and wake on the next request.
- Your own image. Useful when the sandbox needs your tools: you ship any linux/amd64 image, while OpenAI gives every container the same Debian 12 image.
- Sleeps when idle, wakes on request. Useful for many short, spiky sessions: a sandbox sleeps when idle, wakes on the next request, and bills CPU only while busy.
- Reachable and programmable network. Useful when users must open what runs inside: previews route through your Worker, and outbound handlers run your code on each request.
Use OpenAI Containers when
your app already calls OpenAI models and the model only needs to run short pieces of code or shell commands on files you give it.
- Built into the model call. Useful if your app already calls OpenAI models: one tool line in a request gives the model a place to run code.
- Locked-down network by default. Useful if code must only reach chosen hosts: Code Interpreter and Hosted Shell have no outbound access until an admin allows domains.
- Nothing to deploy. Useful if you run no servers: there is no Worker, image or plan to set up, and an idle container cleans itself up.
Where boat fits
Cloudflare Sandbox and OpenAI Containers are both built for short runs that end and forget. If your agents work for hours or days, build with Docker, or need a desktop and ports you can open, look at boat: a full VM that keeps its disk, with coding agents you drive from outside.
A disk that stays
On Cloudflare the disk resets when a sandbox sleeps unless your code saves a snapshot or R2 backup, and OpenAI discards all data after 20 idle minutes. boat saves the disk every minute and on stop, and a stopped sandbox costs nothing.
A whole machine with root
Cloudflare runs Docker with iptables off and 20 GB of disk by default; OpenAI runs commands without sudo and documents no Docker. On boat an agent gets root, systemd, full Docker and /dev/kvm for emulators.
Agents and apps you can reach
OpenAI containers take no inbound connections, and Cloudflare previews only pass through a Worker you write. boat gives HTTPS URLs on 50 ports, raw TCP and a 60fps desktop, with Claude Code, Codex and others driven from outside.
Use boat when your agents do real work for hours: builds, full Docker, emulators and a desktop, on a machine that keeps its files and ports you can reach. Compare it one to one: boat vs Cloudflare Sandbox and boat vs OpenAI Containers.
Questions people ask
Is Cloudflare Sandbox cheaper than OpenAI Containers?
In the scenarios on this page, yes: one coding agent on workdays comes to $39 a month on Cloudflare and $228 on OpenAI, and 300 user sandboxes come to $476 against $1,620. OpenAI also bills model tokens on top. boat comes to $20 and $200 for the same two.
Which is faster?
There is no comparable measurement. Neither Cloudflare Sandbox nor OpenAI Containers has a result on the public CPU benchmark, and OpenAI does not publish vCPU per container size. boat did 26.69 runs per second at 4 vCPU / 8 GB.
Can I run Docker in Cloudflare Sandbox or OpenAI Containers?
On Cloudflare, yes, with docker:dind and the daemon's iptables and IP forwarding turned off. OpenAI's docs say hosted shell commands do not run with sudo, and no Docker support is documented. boat runs full Docker with root and systemd.
Do they keep my files?
Cloudflare keeps files only while the container runs; after sleep it starts from a fresh disk unless your code saved a snapshot or R2 backup. OpenAI discards a container's data when it expires after 20 idle minutes. boat keeps the disk on its own.
Can I open a web app running inside the sandbox?
On Cloudflare, yes, through HTTP and WebSocket previews routed by your Worker. OpenAI containers have no ports, URLs or SSH. boat gives HTTPS URLs for up to 50 ports, raw TCP and SSH.
Can I limit where the sandbox connects to?
Both can. Cloudflare's allowedHosts blocks every host not on your list, and outbound handlers can change each request. OpenAI's Code Interpreter and Hosted Shell have no outbound access until an admin adds domains to the org allowlist.
Try boat
Install the CLI, then run boat new.
7-day free trial
More comparisons
- boat vs Cloudflare Sandbox
- boat vs OpenAI Containers
- E2B vs Cloudflare Sandbox
- Daytona vs Cloudflare Sandbox
- Modal vs Cloudflare Sandbox
- Vercel Sandbox vs Cloudflare Sandbox
- Cloudflare Sandbox vs Blaxel
- Cloudflare Sandbox vs Runloop
- Cloudflare Sandbox vs Tensorlake
- Cloudflare Sandbox vs Morph Cloud
- Cloudflare Sandbox vs CodeSandbox SDK
- Cloudflare Sandbox vs Northflank