OpenAI opened a public beta of its new Agents API on September 10, giving developers direct access to the managed agent infrastructure that powers Codex. A single API call now handles long-lived agent sessions, tool use via MCP and custom tools, and coordination of multiple subagents on one task.
The API is built around four concepts: an Agent (model, instructions and tools), an Environment (an optional sandbox for file access and command execution), a Session (a durable agent instance), and Events/Items covering inputs and outputs. Built-in features include automatic context compaction for long-running sessions, a tool-search mechanism that cuts token usage, and parallel programmatic tool calling. Developers can run agents in an OpenAI-hosted sandbox or self-host via `codex exec-server`, with partner integrations including Cloudflare, DigitalOcean, E2B, Modal, Oracle and Vercel.
There is no separate Agents API fee — usage is billed through the models, tools and container time consumed. OpenAI reported vendor results from early testers: Ciridae improved its evaluation score from 0.71 to 0.85 with a 4x latency reduction, SafetyKit cut its per-case cost by 60%, and Hypha saw 86% fewer failed responses. The beta currently supports only US data residency and does not support Zero Data Retention.
