No environment
Use environment.type: none when the task can use model output, remote MCP, and application function handlers. There is no environment filesystem, built-in Bash, apply-patch, or executor MCP. This is often sufficient for service lookups and text-based work.
OpenAI-hosted environment
Use openai_hosted for scripts, file editing, and artifacts. OpenAI provisions and manages the sandbox. Configure packages, input files, and network permissions. Keep application API credentials outside the sandbox. Hosted compute has its own billing in addition to model usage.
Self-hosted environment
Use self_hosted for private networks or custom software. Your infrastructure provisions the environment and connects an executor. You own provisioning, reconnecting, shutdown, and file persistence. The harness still runs at OpenAI; self-hosting compute does not self-host the entire agent service.
Match ownership to need
A managed report generator can use hosted compute. An agent that queries a private service may need an environment-origin MCP connection and self-hosted networking. Check required endpoints, lifecycle handling, and data controls before choosing based only on provider familiarity.
Read the official reference
Check the source for current API fields, account requirements, and service limits.
OpenAI: architecture