Skip to content

OpenAI Agents API

The OpenAI Agents API provides developers with a managed runtime for building durable cloud agents using the Codex harness, handling orchestration and context management.

Paid · Web API

stork
I am one still image.
One typed sentence. This clip cost 5 cents, the minimum per video.
Make a photo talk for 20 cents a minute.
Upload one photo and type the words. No subscription. One free video a day.
Make one freeDevelopers: there is an API

What is OpenAI Agents API?

OpenAI Agents API is an AI agent orchestration tool developed by OpenAI that enables developers to build and run durable cloud agents with a managed Codex harness. It allows applications to access the Codex (technology) harness through an OpenAI-managed API, handling sessions, orchestration, context compaction, and recovery while the application provides tools and chooses its execution environment. The API was launched in public beta on September 10, 2026, making its managed service available to a broader developer base. It supports advanced capabilities such as reasoning, tool calling, and code execution within sandboxed environments, leveraging models like OpenAI GPT-6 Astra and OpenAI GPT-5.6 Sol.

Key Features of OpenAI Agents API

The OpenAI Agents API provides a comprehensive set of Features (other) designed to streamline the development and deployment of AI agents. These capabilities offload significant infrastructure management from developers, allowing them to focus on the core logic of their Agent (technology).

  • Managed Codex (technology) harness for agent orchestration and execution.
  • Automated Session (technology) management for persistent agent interactions.
  • Context compaction to maintain relevant information across long-running tasks.
  • Robust recovery mechanisms for agent failures.
  • Support for defining Agent (technology) model, instructions, and tools.
  • Flexible Environment (technology) selection for running the Agent (technology).
  • Event (technology) handling for managing inputs and outputs.
  • Proprietary function calling for tool integration.
  • Multimodal capabilities including text, vision, and audio processing.
  • Access to OpenAI GPT-6 Astra, OpenAI GPT-5.6 Sol, OpenAI GPT-5.6 Terra, OpenAI GPT-5.6 Luna, and OpenAI GPT-4.1 models.

Who Should Use OpenAI Agents API?

The OpenAI Agents API is primarily targeted at developers and businesses seeking to implement durable, cloud-based AI agents for complex, multi-step workflows. Its managed service approach is beneficial for organizations that require robust orchestration and context management without building the underlying infrastructure from scratch.

  • Developers building AI agents that can reason and call tools for automated task completion.
  • Teams creating agents that can plan and complete tasks using tools, such as incident response or customer support bots.
  • Engineers developing agents that can work with files and produce artifacts in a sandbox, useful for GitHub issue investigation or data analysis.
  • Organizations implementing multi-agent orchestration for complex workflows like clinical-development intelligence.
  • Businesses automating multi-step work and maintaining context across steps, such as software-release recovery.

How to Use OpenAI Agents API

To use the OpenAI Agents API, developers interact with the API endpoints to define agent behavior, integrate tools, and manage execution environments. The API handles the underlying orchestration and session management, simplifying agent deployment.

  1. Access the OpenAI Agents API documentation at https://developers.openai.com/api/docs/guides/agents-api/overview.
  2. Define the agent's instructions, the OpenAI model to be used (e.g., GPT-6 Astra), and the tools it can access.
  3. Specify the execution environment for the agent, such as an OpenAI-hosted sandbox.
  4. Initiate agent sessions through the API for specific tasks.
  5. Monitor agent execution and handle events for inputs and outputs.
  6. Integrate custom tools or leverage OpenAI's built-in tools like web search and file search.

OpenAI Agents API Pricing & Plans

During its public beta phase, there is no additional fee for using the OpenAI Agents API itself. Costs are incurred based on the consumption of underlying OpenAI resources. This includes usage of OpenAI models, built-in tools, and OpenAI-hosted sandboxes.

  • Model Usage: Billed at standard API rates for selected OpenAI models (e.g., gpt-5.6-luna at $0.20 per 1 million input tokens, gpt-6-astra at $10 per 1 million input tokens as of September 11, 2026). 'Long context' models (above 272,000 input tokens) are approximately double the standard rate.
  • Tool Usage: Standard rates apply for built-in tools; web search costs $10 per 1,000 calls, and file search costs $2.50 per 1,000 calls plus $0.10/GB/day for storage (with 1 GB free).
  • Code Interpreter/OpenAI-hosted Sandboxes: Billed by the container, with rates from $0.03 to $1.92 per 20-minute session, depending on container size (e.g., 1 GB for $0.03, 64 GB for $1.92).

Pros

  • Managed service offloads orchestration, context compaction, and recovery, reducing developer overhead.
  • Provides access to advanced OpenAI models, including GPT-6 Astra and GPT-5.6 Sol, with large context windows (1,050,000 tokens).
  • Supports proprietary function calling and multimodal capabilities (text, vision, audio).
  • Enables the creation of durable, long-running agents capable of complex, multi-step workflows.
  • Offers sandboxed execution environments for secure code execution and file manipulation.

Cons

  • Potential for vendor lock-in due to reliance on OpenAI for models, context management, tools, and execution environment.
  • Pricing is usage-based, which can lead to variable costs depending on agent activity, model choice, and tool usage.
  • Currently in public beta, indicating potential for changes in features, pricing, or stability.
  • Less flexibility for developers who prefer to self-host or integrate with a wider range of non-OpenAI models and custom infrastructure.
  • Requires adherence to OpenAI's specific API structure and ecosystem, which may not align with all existing tech stacks.

OpenAI Agents API vs Competitors

The AI agent landscape features various solutions, ranging from managed services to open-source frameworks. The OpenAI Agents API differentiates itself through its fully managed service, offloading significant operational overhead from developers.

See every OpenAI Agents API alternative, compared

OpenAI Agents API

Paid · Web API

Enjoying this? Get one like it in your inbox each morning.

one email a day · unsubscribe in two clicks · no third-party tracking