A Managed Harness for Complex Agent Workflows

The Agents API abstracts the infrastructure and orchestration logic required to run production-grade AI agents. By providing a managed version of the "Codex harness," OpenAI handles the complexities of context management, tool execution, and subagent coordination. This allows developers to focus on defining agent capabilities, knowledge sources, and specific workflows rather than building custom orchestration layers.

Key Architectural Capabilities

  • Automated Context Management: To support long-running sessions, the API includes automatic context compaction. This prevents agents from hitting token limits by condensing earlier interaction history while preserving essential information for ongoing tasks.
  • Efficient Tooling & Parallelization: The API supports Model Context Protocol (MCP), custom functions, and web search. It optimizes performance through "tool search" (loading definitions on-demand) and programmatic tool calling, which allows agents to run operations in parallel and filter data before returning results to the context window.
  • Multi-Agent Orchestration: Developers can enable multi-agent support to break complex tasks into independent sub-tasks. The main agent manages these subagents, which operate in parallel with their own isolated contexts, significantly speeding up research and coding workflows.

Flexible Compute and Deployment

Developers can choose where their agent's code runs, balancing control and convenience:

  • OpenAI-Hosted Sandboxes: A managed, secure environment for running code, file manipulation, and artifact generation, identical to the infrastructure powering ChatGPT.
  • Self-Hosted/Partner Environments: Integration with providers like Modal, Cloudflare, Daytona, DigitalOcean, E2B, Oracle, Runloop, and Vercel allows developers to run agents on their own infrastructure while still utilizing the OpenAI-managed harness.

Open-Source Foundation

The core logic of the harness is available via the public Codex GitHub repository. This provides transparency into how the system coordinates model calls, tools, and context, allowing developers to inspect the underlying mechanics while OpenAI handles the operational maintenance and versioning.