OpenAI launched its Agents API in public beta on September 10, 2026, turning the Codex agent harness into a managed cloud service. Developers can define an AI agent, connect its tools, select an execution environment, and start durable sessions without building the entire control loop themselves.
The important change is architectural. A conventional model API returns responses and tool calls, leaving the application to manage execution, context, retries, orchestration, and recovery. The Agents API runs that surrounding harness for the developer. OpenAI says the resulting agents can keep working for hours or days, survive interruptions, and coordinate subagents while remaining steerable.
OpenAI pairs the service with gpt-6-astra, its agentic coding model designed to power these longer-running workflows. The launch pitch is summarized neatly in the accompanying X post:
OpenAI Is Turning the Codex Harness Into Infrastructure
An agent model does not become useful simply because it can call a function. It needs a harness that decides when to inspect files, run commands, invoke external services, revise a plan, compress old context, recover from failures, and stop.
OpenAI already exposes that orchestration layer locally through the open-source Codex App Server. The Agents API provides a cloud-hosted version of the Codex harness, with OpenAI operating the session and orchestration infrastructure. Developers can still control the prompts, tools, model configuration, and compute environment.
The Agents API architecture centers on four concepts:
- Agent: Reusable configuration covering instructions, model settings, tools, skills, plugins, and execution policy.
- Environment: The sandbox in which the agent can read files, execute code, and interact with permitted systems.
- Session: A durable instance of the agent performing a task.
- Items and events: Structured records describing messages, tool calls, subagent activity, progress, and output.
This structure makes an agent session closer to a managed workload than a sequence of chat messages. The developer specifies the work and monitors events while the Codex harness maintains the loop around the model.
The API Separates the Agent Harness From the Sandbox

“Fully managed by OpenAI” does not require every command to run on OpenAI-controlled compute. The Agents API separates the hosted harness from the environment where generated code executes.
Developers can choose among three broad approaches:
- An OpenAI-hosted sandbox with Python, Node.js, common command-line tools, package installation, file storage, and configurable network access.
- A self-hosted sandbox running on the developer’s own infrastructure.
- A managed environment from partners including Daytona, E2B, Runloop, and Modal.
For a self-hosted environment, OpenAI’s codex exec-server process runs inside the sandbox and opens an outbound WebSocket connection to the Agents API. The harness sends commands through that connection, while files and execution stay within the developer-controlled environment. A restricted executor key authenticates the sandbox without providing full API access.
That separation is one of the launch’s strongest technical decisions. An organization can use OpenAI’s managed orchestration while retaining its own container images, regional infrastructure, internal dependencies, security controls, and data-access policies.
However, “connect it to any sandbox” should not be read as automatic compatibility with arbitrary compute. In practice, the environment must run the executor integration and support the command, file, and event protocol expected by the harness.
Durable Sessions Change the Programming Model
Agents API sessions are designed for work that cannot be completed reliably in a single synchronous request. Applications can start a session asynchronously, stream its events, poll for status, or receive webhook notifications when important events occur.
OpenAI’s session documentation says the service maintains context, compacts long histories, retries certain tool operations, and rehydrates interrupted sessions. Developers can also steer an active session by adding instructions instead of terminating the job and starting again.
This removes a considerable amount of distributed-systems work. A production agent would otherwise need its own state store, worker queue, context-compaction logic, recovery process, and event protocol.
Managed sessions do not eliminate the need to inspect results. OpenAI notes that a session marked as completed can still contain individual tool failures. Applications should examine structured events and tool records rather than treating the final status as proof that every intermediate action succeeded.
Bring Your Own Tools, Connectors, and Compute

Agents can use OpenAI tools such as web search alongside custom functions, shell commands, skills, plugins, and Model Context Protocol connections. The MCP integration supports both remote servers reached by the Agents API service and local servers accessed from inside the execution environment.
Image: Self-hosted sandboxes | OpenAI API.

That distinction matters for private systems. A remote MCP server might expose an approved SaaS connector, while a local MCP server could provide access to an internal database or service that is reachable only from the company’s network. Developers can decide which part of the system initiates the connection and where the credentials live.
The environment abstraction also allows an agent to work with existing programming infrastructure rather than a narrow set of OpenAI-hosted utilities. A team could provide a container containing its compiler, repository, test suite, internal CLI, deployment scripts, or data-processing dependencies.
The practical result is a division of responsibility:
- OpenAI manages model execution, the Codex harness, session state, and orchestration.
- The developer controls agent instructions, available tools, permissions, and sandbox configuration.
- The sandbox handles code execution, files, packages, and permitted network activity.
- External services remain behind the developer’s authentication and authorization policies.
This approach gives the Agents API a wider target than coding assistants alone. The same structure could support incident investigation, data analysis, software maintenance, internal research, document processing, or operational workflows that require many tool calls.
Astra Can Delegate Work and Search for the Right Tools

OpenAI positions gpt-6-astra as the model designed to power the Agents API, but the surrounding harness features may matter as much as the model itself.
The API supports multi-agent orchestration, allowing a coordinator to delegate independent tasks to subagents. A programming agent could ask one subagent to inspect a repository, another to review documentation, and a third to run tests, then combine their results in the parent session.
Parallelism is not free. OpenAI’s documentation recommends subagents for work that can proceed independently and acknowledges that delegation increases token consumption and latency. Splitting a tightly coupled task among too many agents may create more coordination work than useful progress.
Astra also supports tool search. Instead of placing every available function schema into the initial context, developers can mark large tools or namespaces as deferred. The model searches for and loads a tool only when the task requires it. That keeps extensive MCP catalogs and enterprise integrations from consuming context before the agent knows what it needs.
Programmatic tool calling takes a different approach. The model can generate Python code that invokes several tools inside a container, processes their results, and returns a smaller final result. Intermediate outputs do not all need to travel back through separate model turns, which can reduce round trips and prevent large tool responses from filling the context window.
“Let Astra cook” therefore has a concrete technical meaning: give the model an execution environment, a searchable tool catalog, and the ability to delegate work without forcing the application to coordinate every step.
Frequently Asked Questions
5 questions
1What is the OpenAI Agents API?
The OpenAI Agents API is a managed cloud runtime for building and operating long-running AI agents with the Codex harness. It manages durable sessions, context, orchestration, recovery, event streaming, and subagents. Developers provide the agent configuration, tools, connectors, and execution environment instead of constructing and hosting the complete agent loop.
