Back to News
User submissiondevelopers.openai.com

OpenAI introduces the Agents API for managed Codex applications

Summary

OpenAI’s Agents API gives applications access to the Codex harness through an OpenAI-managed API. OpenAI handles sessions, orchestration, context compaction, and recovery, while developers provide tools and select the execution environment. Agents can work in a sandbox to run commands and code, edit files, connect to MCP servers, apply skills, and produce artifacts. The API defines four core concepts: an agent containing its model, instructions, tools, and MCP servers; an optional environment; a durable session; and the events and items exchanged during that session. A typical workflow creates a session, configures the agent and environment, submits a task, streams events or receives webhooks, and then continues or steers the same session. The managed harness also supports external data access through tools or MCP, task steering, context summarization, subtask delegation, and session resumption. OpenAI provides examples for incident response, Slack, data analysis, GitHub issue investigation, and document review. Usage is billed at the selected model’s API rates, with standard rates for OpenAI tools and hosted sandboxes. The API currently supports data residency only in the United States and does not support Zero Data Retention; choosing a self-hosted sandbox does not change that eligibility.