The independent reference for AI agent sandboxesLast reviewed
Agent Sandboxesagentsandboxes.org
Sandbox profile · Cloud provider service

OpenAI Code Interpreter & Hosted Shell

Answer in brief

Hosted containers in the OpenAI Responses API that the model uses to run Python (Code Interpreter) or shell commands (Hosted Shell). Convenient for OpenAI-native apps; choose a dedicated sandbox for multi-model agents or persistent workspaces.

By the Agent Sandboxes editors · Updated

Overview

OpenAI’s hosted containers back two Responses API tools: Code Interpreter (Python) and Hosted Shell (a Debian environment with Python, Node.js, Java, Go and more). The model decides when to run code; you manage containers through the Containers API.

It is the lowest-friction option if you already use OpenAI models, but it is tied to that API and is not a general-purpose sandbox for other models or long-running agents.

Notable

  • Memory tiers from 1 GB to 64 GB, fixed for the container’s life.
  • Containers API limited to 100 requests per minute per organization.

OpenAI Code Interpreter & Hosted Shell specifications

AttributeDetails
IsolationDocumented as a fully sandboxed virtual machine; underlying technology not named
DeploymentCloud provider service
Open sourceNo
SDKs and interfacesOpenAI Responses API, Containers API, OpenAI SDKs
Cold start (vendor claim)Not documented
Max session lengthContainers expire after 20 minutes of inactivity and cannot be reactivated
PersistenceFiles and state persist while the container is active; reusable by container ID; no snapshots
GPUNo
NetworkingNo outbound network by default; Hosted Shell can allow specific domains via an org allowlist and per-request network policy, with credential placeholders
PricingPer container per 20-minute session: $0.03 (1 GB), $0.12 (4 GB), $0.48 (16 GB), $1.92 (64 GB); model tokens billed separately
Free tierNot documented
ComplianceNot documented
RegionsNot documented

Facts from OpenAI Code Interpreter & Hosted Shell’s public documentation, verified November 8, 2026. Performance numbers are vendor claims.

Strengths and trade-offs

Strengths

  • You already use the OpenAI Responses API
  • You want zero additional infrastructure
  • You need egress off by default with domain allowlisting

Trade-offs

  • Tied to OpenAI’s API and models
  • Containers expire after 20 idle minutes
  • Isolation technology not documented

Best for: Apps already on the OpenAI Responses API that want model-driven code execution with no extra vendor.

Where OpenAI Code Interpreter & Hosted Shell ranks

How OpenAI Code Interpreter & Hosted Shell compares

SandboxIsolationOpen sourceSelf-host / BYOCCold start (vendor)Max sessionSnapshots / pauseGPUSDKs
OpenAI Code Interpreter & Hosted ShellVM (unspecified)NoNo / NoNot documented20 min idleNo / NoNoOpenAI Responses API, Containers API, OpenAI SDKs
E2BFirecracker microVMYesYes / YesNot documented1 h / 24 h (Pro)Yes / YesNoPython, JavaScript/TypeScript
Azure Container Apps dynamic sessionsHyper-V VMNoNo / NoSub-second (pooled)220 s / execNo / NoNoREST API, Azure CLI, LangChain, LlamaIndex, Semantic Kernel
Google Agent Platform Code ExecutiongVisorNoNo / No<1 s (warm)14-day stateNo / Not documentedNoPython (Agent Platform SDK), REST API

Frequently asked questions

What is OpenAI Code Interpreter & Hosted Shell?
Hosted containers in the OpenAI Responses API that the model uses to run Python (Code Interpreter) or shell commands (Hosted Shell). Convenient for OpenAI-native apps; choose a dedicated sandbox for multi-model agents or persistent workspaces.
How does OpenAI Code Interpreter & Hosted Shell isolate code?
OpenAI Code Interpreter & Hosted Shell documents its isolation as: Documented as a fully sandboxed virtual machine; underlying technology not named.
Is OpenAI Code Interpreter & Hosted Shell open source?
No, OpenAI Code Interpreter & Hosted Shell is not open source.
How much does OpenAI Code Interpreter & Hosted Shell cost?
Per container per 20-minute session: $0.03 (1 GB), $0.12 (4 GB), $0.48 (16 GB), $1.92 (64 GB); model tokens billed separately Check the official pricing page for current rates.
What are the best OpenAI Code Interpreter & Hosted Shell alternatives?

Sources

  1. developers.openai.com/api/docs/guides/tools-code-interpreter
  2. developers.openai.com/api/docs/guides/tools-shell
  3. developers.openai.com/api/docs/pricing

Cite this page

Agent Sandboxes. (2026). OpenAI Code Interpreter & Hosted Shell. agentsandboxes.org. Last reviewed November 8, 2026. https://agentsandboxes.org/sandboxes/openai-code-interpreter/

Found an error or a missing sandbox? Submit a correction — every entry links to the sources it relies on.