Cloudflare Sandbox vs OpenAI Containers

Cloudflare Sandbox gives you a container from your own image, driven by your own Worker. It sleeps when idle, wakes on the next request, and keeps files through snapshots or R2 that your code sets up. OpenAI Containers are a tool inside OpenAI's model API: the model runs Python or shell commands on a fixed Debian 12 image, and by default the container 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. 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. The disk resets when the container stops, and your code keeps files with snapshots, automatic saves, R2 backups or R2 bucket mounts. It suits teams already on Workers who want sandboxes that sleep when idle. For code that only calls known methods, Cloudflare also offers Dynamic Workers, which run JavaScript in V8 isolates.

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 a Responses call makes one. The model runs Python or shell commands in it on a fixed Debian 12 image without sudo. By default the container expires after 20 minutes without use; the create call can set a different idle time. 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. “43rd cheapest of 361” means 42 of the other 360 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 workloadCloudflare Sandbox: price rankOpenAI Containers: price rankboat: 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 needs files that stay. On Cloudflare your code saves snapshots, automatic saves or R2. OpenAI discards a container's data when it expires; the Agents API keeps files in /workspace/outputs as artifacts. boat saves the disk with no code.
192nd of 365, with limits
$1,543 a month
357th of 365, with limits
$17,371 a month
5th cheapest of 365
$634 a month
Always-on AI employees
50 machines 24/7 · 2 vCPU / 4 GB
Always-on assistants need files and logins that stay. On Cloudflare your code saves snapshots or mounts R2. An OpenAI container expires after an idle time you set (20 minutes by default) and its files go. boat saves the disk every minute and at each stop.
43rd cheapest of 361
$2,188 a month
344th of 361, with limits
$13,140 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 are built for short code runs. Cloudflare bills CPU only while busy and wakes on request. OpenAI runs the model's code inside the same API call, with no machine to manage.
17th cheapest of 336
$144 a month
198th of 336, with limits
$6,000 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
Cloudflare fits sandboxes for your users, with previews routed through your Worker. OpenAI documents no inbound ports for hosted containers, so users reach them only through your app. boat adds HTTPS URLs on up to 50 ports.
19th cheapest of 349
$731 a month
349th of 349, with limits
$3,780 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
147th of 349, with limits
$9,428 a month
195th of 349, with limits
$30,000 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
60th cheapest of 359
$818 a month
355th of 359, with limits
$5,760 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
CI jobs that build images need Docker and open internet. Cloudflare runs Docker with iptables turned off and has 20 GB of disk at most. OpenAI documents no Docker or root for hosted containers; the Agents API can drive a sandbox you host.
303rd of 374, with limits
$704 a month
347th of 374, with limits
$1,728 a month
2nd cheapest of 374
$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 a fresh disk after sleep unless your code restores a snapshot (beta, 30 days) or mounts an R2 bucket. OpenAI documents no SSH for hosted containers. boat keeps a stopped disk at least 14 days.
123rd cheapest of 371
$93 a month
365th of 371, with limits
$1,051 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
OpenAI has a hosted browser for the Agents API computer_use tool. On Cloudflare you build a desktop into your image, or use the separate Browser Run service. boat streams a 60 fps desktop you can embed.
207th of 367, with limits
$460 a month
353rd of 367, with limits
$5,280 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
68th of 356, with limits
$233 a month
335th of 356, with limits
$1,440 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
102nd cheapest of 343
$286 a month
334th of 343, with limits
$1,755 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
168th of 327, with limits
$5,741 a month
307th of 327, with limits
$35,100 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
Red-team runs often need raw TCP and full root networking. Cloudflare containers cannot change iptables, and OpenAI's hosted shell runs commands without sudo. boat has root, systemd and raw ports over public IPv6.
25th cheapest of 351
$325 a month
310th of 351, with limits
$870 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 requirementNot ranked: misses a requirementNot 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 requirementNot ranked: misses a requirementNot ranked: misses a requirement

Key features

FeatureCloudflare SandboxOpenAI Containersboat
What it isA container from your image, driven from your own Cloudflare WorkerA sandbox tool the model uses inside OpenAI's APIA cloud VM you create, keep, stop and reach from outside
IsolationFirecracker microVM per container, own kernel and networkA fully sandboxed virtual machine; hypervisor not namedFull VM with its own kernel, on a physical host dedicated to boat (AMD Ryzen 7 9700X or Ryzen 9 9950X); vCPUs are shared
Machine sizeUp to 4 vCPU / 12 GiB / 20 GB disk1, 4, 16 or 64 GB of memory, vCPU not published; Agents API sandboxes up to 4 vCPU / 16 GB4 vCPU / 8 GB by default, up to 16 vCPU / 32 GB (needs the $100 plan or higher)
Custom imageAny linux/amd64 container image you buildFixed Debian 12 image; you upload files or skills into each containerboat's Ubuntu 24.04 image or a saved snapshot of a set-up machine; you cannot boot your own Docker image
Files between sessionsDisk is fresh after sleep; keep files with snapshots (public beta, 30 days), scheduled automatic saves, R2 directory backups or a mounted R2 bucketData discarded when the container expires; Agents API keeps files in /workspace/outputs as downloadable artifactsDisk saved every minute and at each stop, with no code; kept at least 14 days after a stop, longer as a saved snapshot; memory and running programs are not saved
LifetimeNo fixed maximum; stops after an inactivity timeout and wakes on the next request; runtime not guaranteedExpires after 20 minutes without use by default; expires_after sets another idle time, no maximum publishedAuto-stop 1 h by default; up to 30 days, or off on a paid plan with no session cap
Root and Dockerdocker:dind with iptables and IP forwarding turned offCommands do not run with sudo; no Docker documented; the Agents API can drive a sandbox you hostRoot, systemd, Docker with BuildKit and Compose, and /dev/kvm
Fork a running sandboxSnapshot or back up a running sandbox, then start new sandboxes from it; no one-call forkNo fork call documented; create a new container and upload the same filesOne call, without stopping it; the fork uses the last 1-minute snapshot
Inbound trafficHTTP and WebSocket previews routed through your Worker; SSH; no raw TCP inboundNo inbound ports documented for hosted containers; reached through the APISSH, up to 50 HTTPS URLs (token-gated by default), raw ports over public IPv6
Outbound internetOpen by default; allowedHosts deny-by-default list and outbound handlers in Worker codeCode Interpreter and Hosted Shell: off until an admin sets an org domain allowlist; Agents API sandboxes open by default, can be limited to 1 to 100 hostsOpen internet; no provider-side allowlist
Keeping keys out of the sandboxYour outbound handler adds the token for any HTTP or HTTPS host; you write the codedomain_secrets: a sidecar adds the real header for approved domains, the model sees a placeholderOptional paid proxy ($1 a day while on, plus $1 per 1,000 requests) for model providers and HTTPS APIs you register
Coding agentsGuides for Claude Code, Codex, OpenCode and Pi in your imageAgents API (beta) drives a managed Codex harness, with steering, events and webhooksSeven installed (Claude Code, Codex, OpenCode and more), with a prompt, steer and events API
Desktop and computer useBuilt-in desktop removed in SDK 0.10.2; build one into your own image, or use the separate Browser Run service for headless browsersHosted browser for the Agents API computer_use tool1920x1080, 60 fps desktop and Chrome, computer tools, embeddable stream; no GPU
RegionsSeveral regions across Cloudflare's network; pin to a region or jurisdictionUS or EU processing for Code Interpreter; Agents API data residency is US onlyGermany, Finland and France; no US or Asia region; you cannot pick one
Every feature Battleships tracks (43)
FeatureCloudflare SandboxOpenAI Containersboat
Full VM (own kernel)YesYesYes
Docker insideYesNo documented wayYes
Nested virtualizationNo documented wayNo documented wayYes
RootYesNo documented wayYes
SystemdNot publishedNot publishedYes
Desktop GUINo documented wayYesYes
BrowserWith your own setupYesYes
Computer-use APINo documented wayYesYes
SSHYesNo documented wayYes
Persistent diskWith your own setupNo documented wayYes
Pause/resumeNo documented wayNo documented wayYes
Automatic snapshotsWith your own setupNo documented wayYes
Fork/cloneWith your own setupNo documented wayYes
Live fork (no pause)With your own setupNo documented wayYes
Memory forkNo documented wayNo documented wayNo documented way
Custom image (Docker or snapshot)YesNo documented wayYes
≥24 h sessionsYesYesYes
Idle auto-stopYesYesNo documented way
Wake on requestYesNo documented wayNo documented way
HTTPS preview URLsYesNo documented wayYes
Raw TCP inboundNo documented wayNo documented wayYes
Public IPv4No documented wayNo documented wayNo documented way
Egress allowlistYesYesNo documented way
Secret proxyYesYesYes
Secret proxy for any APIYesYesYes
Preinstalled agentsYesNo documented wayYes
Agent harness APIWith your own setupYesYes
MCP serverNo documented wayNo documented wayNo documented way
GPUNo documented wayNo documented wayNo documented way
WindowsNo documented wayNo documented wayNo documented way
Arm64No documented wayNo documented wayNo documented way
Self-hostingNo documented wayYesNo documented way
BYOCNo documented wayNo documented wayNo documented way
Open sourceYesNo documented wayNo documented way
Scoped API keysNot publishedNot publishedYes
Spend limitsNo documented wayNot publishedYes
Usage per sandbox (API)Not publishedNo documented wayYes
Audit logsYesNot publishedNo documented way
SSOYesYesNo documented way
SOC 2YesYesNo documented way
HIPAAYesYesNo documented way
EU data residencyYesYesNo documented way
Zero data retentionNot publishedNot publishedYes

Performance

Cloudflare SandboxNot measured
OpenAI ContainersNot measured
boat28.06 runs/s

Neither Cloudflare Sandbox nor OpenAI Containers is in StarSling's run of 3 October 2026 (run 37073680030), so we cannot say which is faster, and OpenAI does not publish the vCPU behind each container size. In that run 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.

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. Cloudflare Sandbox and OpenAI Containers 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.

ScenarioCloudflare Sandbox, a monthOpenAI Containers, 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
$39 · Workers Paid$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$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$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$8,800 · $2000/mo · with limits

Cloudflare Sandbox: You need Workers Paid ($5 a month minimum). CPU is billed only while busy, at $0.072 per vCPU-hour. Memory and disk are billed on the instance size in 10 ms steps until the container sleeps. 4 vCPU always comes with 12 GiB. Snapshot pricing is not published.

OpenAI Containers: OpenAI bills each container session 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. The scenarios use the 16 GB size ($1.44 an hour) for 8 GB needs, because OpenAI does not publish the vCPU per size.

OpenAI Containers: Plans cost $20, $100, $500 or $2,000 a month, and the whole plan price comes back as VM time for that month. A default 4 vCPU / 8 GB sandbox costs $0.036 an hour, billed per second while it runs, busy or idle. The $20 plan includes 12 starts a minute, 60 an hour and 200 a day; extra starts cost $0.03 to $0.07. A stopped sandbox has no compute charge and keeps its disk at least 14 days. Saved snapshots above the included count ($0.056 a day each) and the AI proxy, if on, still bill while stopped.

Limits in those scenarios

OpenAI Containers do not fit any of the five scenarios as written: hosted containers discard their files when they expire, document no Docker or root, and do not publish vCPU per size. OpenAI also publishes no limit on containers at once, so the 300 user sandboxes and the 1,000-job burst are unconfirmed. Cloudflare keeps files between days only through snapshot, automatic-save or R2 code, and its 1,500 vCPU account cap is short of the 2,000 the burst needs, raised on request. boat does not fit the burst either: the $2,000 plan includes 90 starts a minute and 600 an hour, charges $0.03 to $0.07 for extra starts, and refuses starts above 270 a minute.

ScenarioCloudflare SandboxOpenAI Containersboat
One coding agent, workdaysNone for this scenario
  • no open internet: sandboxes reach only an allowlist (domains your org admin adds to the allow list)
  • missing persistent disk
  • machine size not published
  • different kind of product: code interpreter
None for this scenario
One agent that never stopsNone for this scenario
  • no open internet: sandboxes reach only an allowlist (domains your org admin adds to the allow list)
  • missing persistent disk
  • machine size not published
  • different kind of product: code interpreter
None for this scenario
50 agents in parallelNone for this scenario
  • no open internet: sandboxes reach only an allowlist (domains your org admin adds to the allow list)
  • missing persistent disk, Docker inside
  • machine size not published
  • different kind of product: code interpreter
None for this scenario
Sandboxes for your usersNone for this scenario
  • no open internet: sandboxes reach only an allowlist (domains your org admin adds to the allow list)
  • machine size not published
  • different kind of product: code interpreter
  • not confirmed: how many machines can run at once (you need 300; the typical published limit is 50)
None for this scenario
1,000 short jobs at once
  • Workers Paid: max 1,500 vCPU running at once (needs 2,000)
  • no open internet: sandboxes reach only an allowlist (domains your org admin adds to the allow list)
  • machine size not published
  • different kind of product: code interpreter
  • not confirmed: how many machines can run at once (you need 1,000; the typical published limit is 50)
  • 2,400 starts/day included, paid above that (needs ~6,667)
  • 600 starts/hour included, paid above that (needs ~1,000)
  • starts above 90/min are paid, and starts above 270/min fail with 429

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 both suit short runs. Cloudflare keeps files through snapshot or R2 code you write, and OpenAI keeps output files as artifacts. 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 saves its disk with no code, with coding agents you drive from outside. boat runs only in the EU, has no GPU and limits starts per plan.

Files that stay put with no code

On Cloudflare your code saves snapshots (kept 30 days), automatic saves or R2. An OpenAI container discards its data when it expires. boat saves the disk every minute and at each stop, and keeps a stopped disk at least 14 days. Memory is not saved, so a resume is like a reboot.

A whole machine with root

Cloudflare runs Docker with iptables off on 20 GB of disk. OpenAI's hosted shell runs commands without sudo and documents no Docker. On boat an agent gets root, systemd, Docker with BuildKit and /dev/kvm for emulators.

Agents and apps you can reach

OpenAI documents no inbound ports for hosted containers, and Cloudflare previews pass through a Worker you write. boat gives up to 50 HTTPS URLs, raw ports over public IPv6 and a 60 fps desktop, with Claude Code, Codex and others driven from outside.

Use boat when your agents do real work for hours: builds, Docker, emulators and a desktop, on a VM that saves its disk with no code and has ports you can reach. Compare it one to one: boat vs Cloudflare Sandbox and boat vs OpenAI Containers.

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 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, and it is priced at its 16 GB size because it does not publish vCPU. boat comes to $20 and $200 for the same two. For a few short code runs a month, OpenAI, with no plan fee, can cost less than either.

Which is faster?

We cannot say. Neither Cloudflare Sandbox nor OpenAI Containers is in StarSling's run of 3 October 2026, and OpenAI does not publish vCPU per container size. boat did 28.06 V8 Web Tooling runs/s in that run at 4 vCPU / 8 GB, on an AMD Ryzen 9 9950X host; boat also places some sandboxes on other hosts.

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 Docker is not documented; you can connect the Agents API to a sandbox you host. boat runs Docker with BuildKit and Compose, root and systemd.

Do they keep my files?

Cloudflare keeps files with a snapshot (public beta, 30 days), scheduled automatic saves, an R2 backup or a mounted R2 bucket. OpenAI discards a container's data when it expires, after 20 idle minutes by default; the Agents API keeps output files as artifacts. boat saves the disk every minute and at each stop with no code, and keeps it at least 14 days after a stop.

Can I open a web app running inside the sandbox?

On Cloudflare, yes, through HTTP and WebSocket previews routed by your Worker. OpenAI documents no ports, URLs or SSH for hosted containers. boat gives up to 50 HTTPS URLs, raw ports over public IPv6 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. boat has no provider-side egress allowlist.

Try boat

Install the CLI, then run boat new.

7-day free trial

More comparisons