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.
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
| Attribute | Details |
|---|---|
| Isolation | Documented as a fully sandboxed virtual machine; underlying technology not named |
| Deployment | Cloud provider service |
| Open source | No |
| SDKs and interfaces | OpenAI Responses API, Containers API, OpenAI SDKs |
| Cold start (vendor claim) | Not documented |
| Max session length | Containers expire after 20 minutes of inactivity and cannot be reactivated |
| Persistence | Files and state persist while the container is active; reusable by container ID; no snapshots |
| GPU | No |
| Networking | No outbound network by default; Hosted Shell can allow specific domains via an org allowlist and per-request network policy, with credential placeholders |
| Pricing | 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 |
| Free tier | Not documented |
| Compliance | Not documented |
| Regions | Not 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
| Sandbox | Isolation | Open source | Self-host / BYOC | Cold start (vendor) | Max session | Snapshots / pause | GPU | SDKs |
|---|---|---|---|---|---|---|---|---|
| OpenAI Code Interpreter & Hosted Shell | VM (unspecified) | No | No / No | Not documented | 20 min idle | No / No | No | OpenAI Responses API, Containers API, OpenAI SDKs |
| E2B | Firecracker microVM | Yes | Yes / Yes | Not documented | 1 h / 24 h (Pro) | Yes / Yes | No | Python, JavaScript/TypeScript |
| Azure Container Apps dynamic sessions | Hyper-V VM | No | No / No | Sub-second (pooled) | 220 s / exec | No / No | No | REST API, Azure CLI, LangChain, LlamaIndex, Semantic Kernel |
| Google Agent Platform Code Execution | gVisor | No | No / No | <1 s (warm) | 14-day state | No / Not documented | No | Python (Agent Platform SDK), REST API |
Frequently asked questions
What is OpenAI Code Interpreter & Hosted Shell?
How does OpenAI Code Interpreter & Hosted Shell isolate code?
Is OpenAI Code Interpreter & Hosted Shell open source?
How much does OpenAI Code Interpreter & Hosted Shell cost?
What are the best OpenAI Code Interpreter & Hosted Shell alternatives?
Sources
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.