OpenAI Hosted Sandboxes
https://developers.openai.com/api/docs/guides/agents-api/environments/openai-hosted
OpenAI Hosted Sandboxes provide a Linux workspace that an agent can use to run Python, Node.js, and command-line tools. OpenAI provisions and connects the sandbox, while the application supplies tasks and retrieves results.
| Pricing model | Eligible container sessions billed by the minute with a 5-minute minimum; memory-tier rates per 20-minute session per container; model usage billed separately. |
|---|---|
| Pricing The headline compute price as the provider states it. Sorting ranks prices stated per vCPU over time, converted to hourly. Other pricing models sort after, unranked. | 1 GB: $0.03; 4 GB: $0.12; 16 GB: $0.48; 64 GB: $1.92 per 20-minute session per container |
| Free while idle Whether a stopped, paused, or sleeping sandbox costs nothing. | – |
| Elastic Resources flex with what the sandbox actually uses, and the bill follows: yes when the provider bills on active or observed use, no when capacity is reserved or allocated and billed while it runs. | ✕ |
| Memory snapshots Whether RAM state survives a pause and resume, not just disk. | – |
| Wake on request Whether a stopped sandbox wakes automatically on inbound traffic. | – |
| Start / resume Typical time from create or resume to running. Sorting ranks stated times, converted to seconds; claims with no figure sort after, unranked. | – |
| Max runtime The longest a sandbox may run. | – |
| Isolation The isolation technology between sandboxes. | – |
| GPUs Whether GPU instances are available for sandboxes. | – |
| Docker Whether Docker containers can run inside the sandbox. | – |
| SDKs | Python, TypeScript/JavaScript, Java, Go, Ruby |
✓ yes · ✕ no · – no cited public fact.
Each session gets a separate workspace, and files persist across turns only while the sandbox exists. If activity and keep-alives stop for an hour, OpenAI can delete the sandbox, and the timeout is not configurable. Pre-warming is free, but unattached pre-warmed environments expire after 5 minutes, and standard container pricing applies after attachment. A newly created shared environment supports up to 128 attached sessions, shares one workspace, and starts a 20-minute idle lifetime at first attachment. Activity in any attached session or through the environment file API extends it. Older environments can still have a single-session lifecycle.
Sources
- https://developers.openai.com/api/docs/guides/agents-api/environments/openai-hosted
- https://developers.openai.com/api/docs/guides/agents/sandboxes
- https://developers.openai.com/api/docs/pricing
- https://developers.openai.com/api/docs/guides/agents-api/environments/security
- https://developers.openai.com/api/docs/guides/agents-api/overview
- https://developers.openai.com/api/docs/guides/agents-api/environments/lifecycle
- https://developers.openai.com/api/docs/guides/agents-sdk
- https://developers.openai.com/api/docs/guides/agents-api/environments/prewarmed
- https://developers.openai.com/api/docs/libraries
- https://developers.openai.com/api/docs/guides/agents-api/environments/openai-hosted.md
- https://developers.openai.com/api/docs/guides/agents-api/environments/prewarmed.md
Last verified 2026-10-21. Corrections land through the update log.