agents/apiTHE ENCYCLOPEDIA
Infrastructure

Hosted vs self-hosted sandboxes

Choose no environment, OpenAI-hosted compute, or your own execution infrastructure.

Task requirements
Environment choice
Tool execution
File preservation

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

23 matching topics

What is the OpenAI Agents API?FoundationsAgents API vs Agents SDK vs Responses APIComparisonsAgents API quickstartGetting startedSessions, turns & durable stateCore conceptsHosted vs self-hosted sandboxesInfrastructureConnect MCP servers to Agents APITools & integrationsFunction calling & application toolsTools & integrationsMulti-agent orchestrationCore conceptsStreaming, webhooks & event handlingIntegration guidesFiles, outputs & published artifactsCore conceptsVaults & MCP authenticationTools & integrationsAgent security & credential boundariesProductionTracing, usage & debuggingProductionAgents API pricing & cost planningProductionOpenAI Agents API with PythonGetting startedAgents API with TypeScript & Next.jsIntegration guidesWhat is the OpenAI Agents SDK?FoundationsResponses API in the agent stackFoundationsAgent Skills & SKILL.mdTools & integrationsProgrammatic Tool CallingTools & integrationsRAG, file search & vector storesTools & integrationsWeb search & source citationsTools & integrationsChatKit & Agent BuilderIntegration guides
K to open Esc to close