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.

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 bochka: 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 workloadCloudflare Sandbox: price rankOpenAI Containers: price rankbochka: 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 bochka 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 bochka 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 bochka 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 bochka 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 bochka 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 bochka 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 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

FeatureCloudflare SandboxOpenAI Containersbochka
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 dedicated AMD Ryzen 9 9950X hosts
Machine sizeUp to 4 vCPU / 12 GiB / 20 GB disk by default (can be raised)1, 4, 16 or 64 GB of memory; vCPU not published4 vCPU / 8 GB by default, up to 16 vCPU / 32 GB
Custom imageAny linux/amd64 container image you buildFixed Debian 12 image; you upload files or skills into each containerNamed snapshots of a set-up machine, reused as templates
Files between sessionsFresh disk after sleep; snapshots (public beta, 30 days) or R2 backups when your code saves themData discarded when the container expires; no snapshotsDisk saved every minute and on stop; a stopped sandbox costs nothing
LifetimeNo fixed maximum runtime; sleeps after inactivity, host restarts can stop itExpires after 20 minutes without useNo session cap on paid plans; you set the time to live
Root and Dockerdocker:dind with iptables and IP forwarding turned offCommands do not run with sudo; no Docker documentedRoot, systemd, full Docker and /dev/kvm
Fork a running sandboxNo fork; restore a saved snapshot or backup into a new sandboxNo forkYes, without stopping it
Inbound trafficHTTP and WebSocket previews routed through your Worker; no raw TCPNone; reached only through the APISSH, HTTPS URLs for up to 50 ports, raw TCP
Outbound internetOpen by default; allowedHosts deny list and outbound handlers in Worker codeCode Interpreter and Hosted Shell: off until an admin sets an org domain allowlistOpen internet; no provider-side allowlist
Keeping keys out of the sandboxYour outbound handler adds the token for any HTTP or HTTPS hostdomain_secrets: a sidecar adds the real header, the model sees a placeholderManaged proxy for model providers and any HTTPS API; switch a credential to another account
Coding agentsRun Claude Code, Codex, OpenCode or Pi in your imageAgents API (beta) drives a managed Codex harness, with steering and eventsClaude Code, Codex, OpenCode and more preinstalled, with a prompt, steer and events API
Desktop and computer useBuilt-in desktop removed in SDK 0.10.2; bring your ownHosted browser for the Agents API computer_use tool60fps desktop and Chromium, computer-use API, embeddable stream
RegionsSeveral regions across Cloudflare's networkUS or EU processing for Code InterpreterEU only: Germany, Finland, France
Every feature Battleships tracks (43)
FeatureCloudflare SandboxOpenAI Containersbochka
Full VM (own kernel)YesYesYes
Docker insideYesNoYes
Nested virtualizationNoNoYes
RootYesNoYes
SystemdNot publishedNot publishedYes
Desktop GUINoYesYes
BrowserNoYesYes
Computer-use APINoYesYes
SSHYesNoYes
Persistent diskNoNoYes
Pause/resumeNoNoYes
Automatic snapshotsNoNoYes
Fork/cloneNoNoYes
Live fork (no pause)NoNoYes
Memory forkNoNoNo
Custom image (Docker or snapshot)YesNoYes
≥24 h sessionsYesYesYes
Idle auto-stopYesYesNo
Wake on requestYesNoNo
HTTPS preview URLsYesNoYes
Raw TCP inboundNoNoYes
Public IPv4NoNoNo
Egress allowlistYesYesNo
Secret proxyYesYesYes
Secret proxy for any APIYesYesYes
Preinstalled agentsYesNoYes
Agent harness APIYesYesYes
MCP serverNoNoNo
GPUNoNoNo
WindowsNoNoNo
Arm64NoNoNo
Self-hostingNoYesNo
BYOCNoNoNo
Open sourceYesNoNo
Scoped API keysNot publishedNot publishedYes
Spend limitsNoNot publishedYes
Usage per sandbox (API)Not publishedNoYes
Audit logsYesNot publishedNo
SSOYesYesNo
SOC 2YesYesNo
HIPAAYesYesNo
EU data residencyYesYesYes
Zero data retentionNot publishedNot publishedYes

Performance

Cloudflare SandboxNot measured
OpenAI ContainersNot measured
bochka26.69 runs/s

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. bochka 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.

ScenarioCloudflare Sandbox, a monthOpenAI Containers, a monthbochka, 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 bochka that burst runs into start limits: the $2,000 plan allows 600 starts an hour.

ScenarioCloudflare SandboxOpenAI Containersbochka
One coding agent, workdays
  • missing persistent disk
  • 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 that bite
One agent that never stops
  • missing persistent disk
  • 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 that bite
50 agents in parallel
  • missing persistent disk
  • 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 that bite
Sandboxes for your usersNone that bite
  • 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 that bite
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)
  • 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 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 bochka 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 bochka: 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. bochka 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 bochka 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. bochka gives HTTPS URLs on 50 ports, raw TCP and a 60fps desktop, with Claude Code, Codex and others driven from outside.

Use bochka 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: bochka vs Cloudflare Sandbox and bochka 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. bochka 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. bochka 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. bochka 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. bochka 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. bochka 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 bochka

Install the CLI, then run bochka new.

Product preview

More comparisons

Bochka product preview · Pricing, benchmarks and commands are illustrative. Sandbox provisioning is not connected.