مرکزی مواد پر جائیں
OpenAI

۱۰ ستمبر، ۲۰۲۶

پروڈکٹAPI

Introducing the Agents API

Build and run cloud agents with the Codex harness, fully managed by OpenAI.

لوڈ ہو رہا ہے…

As we’ve scaled Codex and ChatGPT for Work to millions of people around the world, we’ve learned what it takes to make long-running agents work well in practice. Useful agents need a powerful harness that manages context, uses tools efficiently, and coordinates subagents. They also need infrastructure that keeps them running reliably for days, with environments where they can work with files, run code, and save intermediate results.

Today, we’re introducing the Agents API(نئی ونڈو میں کھلتا ہے) in public beta, bringing that same harness and infrastructure that powers Codex to developers through a simple, flexible API.

What our customers are saying about Agents API

8 از 1
”ایجنٹس API کے ساتھ ہمارا جائزہ اسکور 0.71 سے بڑھ کر 0.85 ہو گیا. API میں ذیلی ایجنٹس کی معاونت شاندار ہے اور اس نے ہمارے ورک فلو کو بہت تیز کر دیا. پہلے ہمارے پرانے نظام میں ذیلی ایجنٹس کی نگرانی اور تنظیم کاری خاصی دشوار تھی، مگر نئے APIs نے تاخیر چار گنا کم کر دی. ہم نے اسے بہتر بنانے کی کوشش میں کافی وقت صرف کیا تھا، مگر ذیلی ایجنٹ کے تیار شدہ بہاؤ نے فوراً بہت بڑی بہتری فراہم کی.“
جیک وائسنبرگر، چیف ٹیکنالوجی افسر، Ciridae

Build cloud agents with a single API call

With the Agents API, you can create a production-ready agent in a single API call by specifying the task, model, tools, and environment:

JavaScript

1
import OpenAI from "openai";
2

3
const client = new OpenAI();
4

5
const session = await client.beta.agents.sessions.create({
6
agent: {
7
model: "gpt-6-astra",
8
tools: [
9
{
10
type: "mcp",
11
server_label: "observability",
12
transport: {
13
type: "http",
14
server_url: "https://observability.example.com/mcp",
15
},
16
},
17
],
18
multi_agent: { enabled: true, max_concurrent_subagents: 3 },
19
},
20
vault_ids: ["vault_YOUR_VAULT_ID"],
21
environment: {
22
type: "openai_hosted",
23
capability_directories: ["/workspace/capabilities/skills"],
24
},
25
input:
26
"Investigate service-api’s elevated 5xx rate over the last 30 minutes. " +
27
"Delegate deployment, error, and dependency analysis to subagents. " +
28
"Save findings, evidence, and recommended mitigation in /workspace/outputs.",
29
});

OpenAI hosts and maintains the harness. You choose the agent’s compute environment: in an OpenAI-managed sandbox, on your own infrastructure, or with one of our sandbox partners. The Agents API gives you a strong foundation for building agents on top of our optimized agent harness and infrastructure, so you can focus on the tools, knowledge, and workflows that make your agent unique.

ایک ایپلیکیشن ایجنٹس API کو کام بھیجتی ہے اور واقعات اور نتیجہ وصول کرتی ہے. ایجنٹس API زیر انتظام Codex ہارنیس چلاتا ہے، سینڈ باکس کو ٹول کالز بھیجتا اور ٹول کے نتائج وصول کرتا ہے. ایپلیکیشن خود میزبانی والے کمپیوٹنگ وسائل کو کنٹرول کرتی ہے.

ایجنٹس API آپ کے ایجنٹس کو وہی ہارنیس اور بنیادی ڈھانچہ فراہم کرتا ہے جو Codex کے پس پشت ہے.

Choose your agent environment

Different workloads need different compute, storage, and deployment options. The Agents API lets you choose a sandbox that fits your application.

We’re partnering with ecosystem providers(نئی ونڈو میں کھلتا ہے), including Blaxel, Cloudflare, Daytona, DigitalOcean, E2B, Modal, Oracle, Runloop, and Vercel, to provide first-class integrations for a range of needs:

  • Fully managed environments or deployments within your VPC
  • Specific file and secret storage mechanisms
  • Different CPU, GPU, and memory configurations, with performance, cold-start, and cost profiles to match your company’s workflow.
سینڈ باکس شراکت دار: Modal، Cloudflare، Daytona، Blaxel، Runloop، Vercel، Oracle، E2B اور DigitalOcean.

ایجنٹس API مقبول ماحولیاتی نظام کے فراہم کنندگان کے ساتھ اعلیٰ معیار کے انضمام پیش کرتا ہے.

OpenAI hosted sandboxes

For developers who want to get started quickly and scale efficiently, we’re also introducing the OpenAI hosted sandbox(نئی ونڈو میں کھلتا ہے). This leverages the same sandboxing infrastructure that powers Codex and ChatGPT.

OpenAI provisions and manages the sandbox, giving your agent a secure and performant environment to run code, work with files, and produce artifacts. These sandboxes can be flexibly configured with your files, packages, skills and plugins to give the agent what it needs to complete the task.

Build with an evolving Codex harness

Taking advantage of new model capabilities often means reworking your harness, taking valuable time away from improving your application. The Agents API provides versioned access to these capabilities with each model launch. We maintain and continuously improve the harness alongside our models, helping your agents get better performance from every upgrade. For example, recent improvements to the harness include:

Keep agents working across long sessions

To support models working for hours, we’ve built context management that helps agents carry relevant information across longer sessions. The Agents API automatically compacts(نئی ونڈو میں کھلتا ہے) earlier context as a session approaches its context limit, preserving information the agent needs to continue. Developers can build workflows that span multiple context windows without implementing their own compaction logic.

Help agents efficiently use more tools

The Agents API helps agents find the right tools and use them efficiently. Tool search(نئی ونڈو میں کھلتا ہے) loads relevant tool definitions as needed, helping reduce token usage and cost while preserving the model’s cache. Once tools are available, programmatic tool calling(نئی ونڈو میں کھلتا ہے) lets agents run calls in parallel, chain related operations, and filter or combine results in code so they can work through large volumes of data while bringing only the relevant results back into context. The Agents API supports MCP, custom functions, and built-in tools like web search.

JSON

1
"agent": {
2
"tools": [
3
{
4
"type": "mcp",
5
"server_label": "openai_docs",
6
"transport": {
7
"type": "http",
8
"server_url": "https://developers.openai.com/mcp"
9
}
10
},
11
]
12
}

Let agents parallelize work with subagents

With multi-agent support(نئی ونڈو میں کھلتا ہے), the Agents API can break complex tasks into independent pieces and delegate them to subagents that work in parallel. Each subagent maintains its own context, helping it stay focused on its assignment, while the main agent coordinates their work and brings the results together. This can speed up research, analysis, and coding tasks that benefit from parallel work, without requiring you to build your own orchestration.

JSON

1
"agent": {
2
"model": "gpt-6-astra",
3
"multi_agent": {
4
"enabled": true,
5
"max_concurrent_subagents": 3,
6
}
7
}

An open-source foundation

The Agents API is powered by the open-source Codex harness, giving developers visibility into the core logic that coordinates model calls, tools, and context. With the Agents API, OpenAI operates and maintains that harness while developers can inspect and learn from its public codebase(نئی ونڈو میں کھلتا ہے).

Start building

Agents API is available in public beta today to all developers. There are no additional fees for using the Agents API – you simply pay for the tokens and tools your agents use, as outlined on our pricing page(نئی ونڈو میں کھلتا ہے).

Explore the Agents API overview(نئی ونڈو میں کھلتا ہے) to learn more, or follow the quickstart(نئی ونڈو میں کھلتا ہے) to get started and bring the harness behind Codex into your own agents.

During the public beta, we’ll iterate quickly based on your feedback as we work toward general availability. Let us know what’s working, where you’re running into friction, and what you need to build and run your agents in production.

مصنف

OpenAI