OpenAI has launched the Agents API in public beta. The API gives developers access to the same agent harness and infrastructure that runs Codex and ChatGPT for Work, aimed at long-running agents that operate for hours or days.

A single API call specifying task, model, tools and environment creates a production-ready agent. OpenAI hosts and maintains the harness, while the compute environment is the developer's choice: an OpenAI-managed sandbox, the developer's own infrastructure, or a sandbox partner. Named partners include Blaxel, Cloudflare, Daytona, DigitalOcean, E2B, Modal, Oracle, Runloop and Vercel, covering managed environments, VPC deployments, custom file and secret storage, and various CPU, GPU and memory configurations.

A new OpenAI hosted sandbox option reuses the sandboxing infrastructure behind Codex and ChatGPT. Sandboxes can be configured with files, packages, skills and plugins.

The harness adds automatic context compaction near the context limit, tool search that loads tool definitions on demand to cut token usage, and programmatic tool calling for parallel, chained calls. Multi-agent support delegates subtasks to parallel subagents with their own context. MCP, custom functions and built-in tools like web search are supported.

The harness is the open-source Codex codebase on GitHub. The API is free to use beyond token and tool costs and is available to all developers during the beta.