Agent sandboxes / OpenAI Containers (Code Interpreter / Hosted Shell) alternative

OpenAI Code Interpreter alternative

OpenAI containers power model-connected tools such as Code Interpreter and Hosted Shell. Code Interpreter can reuse an active container, but its expiry policy differs from the Agents API’s OpenAI-hosted sandbox. Neither a billing session nor a saved output artifact should be mistaken for an indefinitely retained Linux computer.

Reviewed 2026-10-18 · Published by the Sandbox0 team

When OpenAI Containers (Code Interpreter / Hosted Shell) fits

OpenAI fits applications wanting model-integrated analysis, generated files and hosted tool execution through its APIs. Its Agents API also keeps session workspace files across turns and publishes output artifacts; retain that integrated orchestration when it matches the application.

When to consider Sandbox0

Consider Sandbox0 when your own agent needs durable system packages, configuration and growing files across compute lifecycle, with supported paused-file access. You implement or adapt model/tool orchestration and artifact handling separately.

Capabilities

OpenAI Containers (Code Interpreter / Hosted Shell) and Sandbox0: what persists?

Feature comparison with documentation and verification status
Environment and runtime lifetimeOpenAI Containers (Code Interpreter / Hosted Shell)Code Interpreter expires after 20 idle minutes; Agents API hosted sandboxes use a separate one-hour inactivity/keep-alive rule. Billing sessions and exported output artifacts have different lifetimes.View evidence ↗Sandbox0ttl and hard_ttl default to 0 (disabled). Configure idle pause and deletion policies for the same persistent sandbox identity; an idle running sandbox still accrues compute charges.Read documentation →
Persistent filesOpenAI Containers (Code Interpreter / Hosted Shell)Active tool files persist within the container; Code Interpreter expiry discards all container data. Agents API workspace/artifact rules are separate.View evidence ↗Sandbox0The writable RootFS survives successful checkpoints, including software, system configuration, dependencies, and user data.Read documentation →
Whole RootFSOpenAI Containers (Code Interpreter / Hosted Shell)Per-session workspace continuity is documented; durable complete writable RootFS recovery across compute replacement is not established.View evidence ↗Sandbox0Persistence extends beyond /workspace to paths such as /usr/local, /etc, and /home. Runtime tmpfs and virtual filesystems are excluded.Read documentation →
Release compute, keep stateOpenAI Containers (Code Interpreter / Hosted Shell)An expired Code Interpreter container cannot resume; a general machine pause/checkpoint interface is not established.View evidence ↗Sandbox0Pause compute between tasks; resume on available capacity. Default resume starts fresh processes from the saved filesystem.Read documentation →
Memory and process stateOpenAI Containers (Code Interpreter / Hosted Shell)Old Python objects are lost at expiry; arbitrary retained-memory checkpoints are not established.View evidence ↗Sandbox0Experimental memory checkpoints can preserve compatible process state. Use memory: true on both pause and resume on a compatible deployment. A filesystem checkpoint alone does not preserve running processes.Read documentation →

Online RootFS growth

On growth-enabled images, Sandbox0 automatically expands the writable RootFS as free space runs low, within a configured sparse logical ceiling up to 64 TiB. Agent processes keep running. Growth is enabled in the qualified Cloud region; confirm activation for other regions. Existing images and snapshots retain their captured storage geometry. The ceiling is logical capacity, not preallocated host disk.

OpenAI’s active container and per-session workspace continuity are acknowledged. The reviewed tool/hosted-environment guides do not establish a durable whole writable RootFS with automatic online growth. Exported output files are useful artifacts, not the complete installed Linux system.

Files while compute is paused

Sandbox0's Files API reads persistent files without resuming compute. Filesystem-only pauses also permit edits; retained-memory pauses are read-only and reject mutations with 409. SSH, SFTP, file watching, and runtime-only mounts require running compute.

Code Interpreter files should be downloaded before expiry, and container operations refresh activity. Agents API output artifacts can outlive a sandbox. Neither flow establishes the same supported full-RootFS read/write interface while guest compute remains paused.

See paused file operations →

Code Interpreter expires after inactivity

The tool guide recommends treating containers as ephemeral. After 20 minutes without use, a container expires, its data becomes unrecoverable and it cannot be reactivated; files must be downloaded while active. Container operations refresh activity, which is different from durable storage independent of compute.

Agents API sandboxes have a different lifetime

The hosted-environment guide keeps files across turns while the sandbox exists. Connected environments receive keep-alives; after an hour without activity or keep-alives they can be deleted, with a non-configurable timeout. Completed-turn copies under /workspace/outputs remain downloadable after expiry. Those artifacts are distinct from the live machine.

A priced session is not a guaranteed machine lifetime

The price table gives memory-tier rates per 20-minute container session and separately says eligible sessions use minute billing with a five-minute minimum. Model tokens are additional. Use the effective eligibility and tool contract rather than converting every session into a generic always-on VM rate.

Pricing

Compare billing models, then price your workload

CPU allocation, memory, billing minimums, disk, plan fees, and supported workload differ. These meters are not equal-performance machine quotes. Confirm region, resource units, and included allowances before estimating a total.

OpenAI Containers (Code Interpreter / Hosted Shell)

Pricing reviewed 2026-10-18

1 GB container
$0.03 per 20-minute session
Published container table; eligible sessions instead bill by minute with a five-minute minimum.
Rate source ↗
4 GB container
$0.12 per 20-minute session
The memory tier applies for the container lifetime.
Rate source ↗
16 GB container
$0.48 per 20-minute session
Container pricing covers Hosted Shell and Code Interpreter; model usage remains separate.
Rate source ↗
64 GB container
$1.92 per 20-minute session
Confirm session-billing eligibility rather than assuming all sessions have identical rounding.
Rate source ↗

OpenAI defines GB in this price table as binary gigabytes, 2^30 bytes. Standard container rates also apply to Agents API hosted sandboxes, with separate model-token charges. Code Interpreter’s inactivity expiry, Agents API keep-alives and billing-session duration are different clocks.

Check current OpenAI Containers (Code Interpreter / Hosted Shell) pricing ↗

Sandbox0

$0.015/GiB-hour compute (billed by the second at approximately $0.000004167/GiB-second), plus $0.02/GiB-month of retained incremental RootFS and memory checkpoint data. Shared base images and platform recovery retention are excluded; paused sandboxes accrue storage charges only.

Compute / GiB-hour
$0.015
Retained data / GiB-month
$0.02
Paused compute
$0.00

A 4 GiB agent, 100 running hours

$6.00 compute

4 GiB × 100 hours, billed by the second. Keeping 20 GiB of billable incremental data for a full billing month adds $0.40. CPU is derived from memory by the platform; choose a tier that fits your workload.

Understand storage billing →

Before migrating from OpenAI Containers (Code Interpreter / Hosted Shell)

  1. Identify Code Interpreter, Hosted Shell or Agents API environment; inventory expiry/activity rules, files, artifacts, packages and effective billing eligibility.
  2. Export required files while available and port model/tool orchestration to Sandbox0 APIs and compatible templates.
  3. Test repeat tasks, system-state retention, RootFS growth, paused files and the actual runtime/storage plus model-token cost.

Common questions

Is Sandbox0 a drop-in OpenAI Containers (Code Interpreter / Hosted Shell) replacement?

Evaluate API compatibility and product scope. A shared sandbox category does not make SDKs, lifecycle semantics, or limits interchangeable.

Does keeping files also keep a running agent?

Filesystem state and volatile process state are separate. Sandbox0 requires explicit compatible memory checkpoints to preserve running processes; its default filesystem resume starts fresh processes.

Sources and review scope

The Boat team's Battleships directory is the discovery source. References below describe the product and plan discussed on this page. Check current availability, regional terms and billing units before migrating. Where the cited material does not establish a capability or price, the comparison identifies that uncertainty.

Related comparisons