New Tools for Building AI Agents: OpenAI Agent SDK, Response API and More

Pankaj Singh Last Updated : 12 Mar, 2025
11 min read

In a significant step toward empowering developers and enterprises to create more reliable and capable AI agents, OpenAI released the Agent SDK on March 11, 2025, alongside a suite of impactful API updates. This release introduces several powerful tools designed to enhance AI-driven applications, including the Responses API, built-in tools, OpenAI Agents SDK, and observability tools. These new capabilities streamline the development process, improve AI reliability, and provide deeper insights into agent performance, ultimately helping businesses and developers build more intelligent, responsive, and efficient AI solutions.

What’s in OpenAI’s New Update?

OpenAI Agent update
Source: Author

Today, a new set of tools is being introduced to help developers and enterprises build reliable and efficient AI agents. Agents, in this context, refer to AI systems that can operate independently to complete tasks on behalf of users.

Over the past year, significant advancements have been made in AI capabilities, including improved reasoning, multimodal interactions, and enhanced safety mechanisms. These developments have laid the foundation for AI to manage complex, multi-step tasks necessary for building effective agents. However, many developers and organizations have found it challenging to transition these capabilities into production-ready agents. The process often requires extensive prompt refinement, custom orchestration logic, and lacks built-in tools for visibility and support.

To address these challenges, a new suite of APIs and tools is now available, designed to streamline the creation and deployment of AI agents:

  • Responses API – Integrates the simplicity of the Chat Completions API with the tool-use capabilities of the Assistants API, making agent development more accessible.
  • Built-in Tools – Includes features such as web search, file search, and computer use, enabling agents to perform a wider range of tasks seamlessly.
  • Agents SDK – A framework for managing both single-agent and multi-agent workflows efficiently.
  • Integrated Observability Tools – Provides visibility into agent workflows, allowing developers to trace and inspect execution for better debugging and optimization.

These tools significantly reduce the complexity of building AI agents by improving core logic, orchestration, and interactions. In the coming weeks and months, additional features and capabilities will be introduced to further enhance and accelerate the development of AI-driven applications.

Responses API

I am running this on the terminal:

Step 1: Required Installations

pip install openai --upgrade

Step 2: Add OpenAI API Key

export OPENAI_API_KEY="your-openai-api-key-here"

Step 3: Create an app.py file

touch app.py

Step 4: Add the following code in the app.py file

from openai import OpenAI
client = OpenAI()

response = client.responses.create(
model="gpt-4o",
input="Give me warm up exercises to do before start of Half Marathon?"
)
print(response.output_text)

Step 5: Run this command to get the output

python app.py

Output

Warming up before a half marathon is important to prepare your body and mind for the race. Here's a simple routine you can follow:

1. **Dynamic Stretching (5-10 minutes):**
- **Leg Swings:** Swing each leg forward and backward, then side to side.
- **Arm Circles:** Make large circles with your arms, both forward and backward.
- **Hip Circles:** Place your hands on your hips and rotate in a circle.
- **Torso Twists:** Stand with feet shoulder-width apart and twist your upper body from side to side.

2. **Light Jogging (5-10 minutes):**
- Begin with a slow, easy jog to gradually increase your heart rate.

3. **Dynamic Drills (5 minutes):**
- **High Knees:** Run in place, bringing your knees up toward your chest.
- **Butt Kicks:** Run in place, kicking your heels toward your glutes.
- **Skipping:** Perform a skipping motion to enhance coordination.
- **Bounding:** Exaggerate each stride to cover more ground with a springy step.

4. **Strides (3-5 bouts):**
- Perform 20-30 second accelerations, gradually increasing your speed, then decelerate. This boosts your neuromuscular activation.

Remember to stay hydrated and listen to your body. Good luck on your race!

Key Changes in the Responses API vs. Chat Completions

The new Responses API is OpenAI’s next step in evolving its API infrastructure, merging the simplicity of Chat Completions with the power of Assistants. Here’s a breakdown of the most notable changes:

1. Stateful vs. Stateless

  • Chat Completions was stateless, meaning developers had to pass entire conversation histories repeatedly.
  • Responses API is stateful, automatically storing responses and enabling seamless continuation of conversations using previous_response_id.

2. Enhanced Functionality

  • Chat Completions worked on a basic list-of-messages-in, message-out model.
  • Responses API introduces Items, a flexible structure representing inputs and outputs (messages, reasoning, function calls, web search, etc.).
  • Now supports file search, web search, structured outputs, and hosted tools natively.

3. Better Streaming & Event Handling

  • Previous APIs used delta streaming (emitting JSON diffs), which was hard to integrate and not type-safe.
  • Responses API introduces semantic events, making it clearer and more structured (response.output_text.delta).

4. Hosted Tools & Vector Search

  • One-line integration for web search, file search, and soon, code execution.
  • New Vector Stores Search API, allowing OpenAI’s RAG capabilities to be used with any model.

5. Improved API Design & Usability

  • Simplified structure by switching from externally-tagged to internally-tagged polymorphism.
  • Flattened JSON response structures, making them easier to parse and work with.
  • Supports form-encoded inputs, making integration smoother.

The Responses API is designed for modern, multimodal, and agentic AI applications, addressing limitations of Chat Completions while ensuring flexibility, efficiency, and ease of use. However, Chat Completions remains supported as a stable option for businesses.

Built-in Tools

Step 1: Required Installations

pip install openai --upgrade

Step 2: Add OpenAI API Key

export OPENAI_API_KEY="your-openai-api-key-here"

Step 3: Create an app.py file

touch app.py

Step 4: Add the following code in the app.py file

from openai import OpenAI
client = OpenAI()

response = client.responses.create(
model="gpt-4o",
tools=[{"type": "web_search_preview"}],
input="Give me the news of ICC Champions Trophy 2025. Include man of the series, man of the match, final match teams, final match score and other relevant details"
)
print(response.output_text)

Step 5: Run this command to get the output

python app.py

Output

India clinched the ICC Champions Trophy 2025 by defeating New Zealand by four wickets in the final held at the Dubai International Cricket Stadium on March 9, 2025. ([reuters.com](https://www.reuters.com/sports/cricket/india-win-champions-trophy-beating-new-zealand-by-four-wickets-final-2025-03-09/?utm_source=openai))

**Final Match Details:**

- **Teams:** India vs. New Zealand
- **Venue:** Dubai International Cricket Stadium
- **Date:** March 9, 2025
- **Toss:** New Zealand won the toss and elected to bat first.
- **New Zealand Innings:** 251/7 in 50 overs
- Daryl Mitchell: 63 runs off 101 balls
- Michael Bracewell: 53* runs off 40 balls
- Rachin Ravindra: 37 runs off 29 balls
- **India Bowling Highlights:**
- Kuldeep Yadav: 2 wickets for 40 runs
- Varun Chakaravarthy: 2 wickets for 45 runs
- **India Innings:** 254/6 in 49 overs
- Rohit Sharma: 76 runs off 83 balls
- Shreyas Iyer: 48 runs off 62 balls
- KL Rahul: 34* runs off 33 balls
- **New Zealand Bowling Highlights:**
- Mitchell Santner: 2 wickets for 46 runs
- Michael Bracewell: 2 wickets for 28 runs

**Awards:**

- **Player of the Match:** Rohit Sharma for his 76 runs off 83 balls. ([espn.co.uk](https://www.espn.co.uk/cricket/series/8081/game/1466428/india-vs-tbc-final-icc-champions-trophy-2024-25?utm_source=openai))
- **Player of the Tournament:** Rachin Ravindra of New Zealand. ([reuters.com](https://www.reuters.com/sports/cricket/india-need-252-win-champions-trophy-2025-03-09/?utm_source=openai))

**Additional Details:**

India's victory marked their third ICC Champions Trophy title, making them the first team to achieve this feat. ([cricketwinner.com](https://www.cricketwinner.com/cricket-news/icc-champions-trophy-2025-final-ind-vs-nz-india-create-history-by-lifting-icc-champions-trophy-third-time/?utm_source=openai)) The tournament faced challenges due to geopolitical tensions, leading to India's matches being played in Dubai instead of the host nation, Pakistan. ([reuters.com](https://www.reuters.com/sports/cricket/geopolitics-lack-buzz-blight-champions-trophys-return-2025-03-10/?utm_source=openai)) Despite these issues, India remained undefeated throughout the tournament, solidifying their position as a dominant force in white-ball cricket. ([reuters.com](https://www.reuters.com/sports/cricket/india-need-252-win-champions-trophy-2025-03-09/?utm_source=openai))


## India's Triumph in ICC Champions Trophy 2025:
- [India win Champions Trophy, beating New Zealand by four wickets in final](https://www.reuters.com/sports/cricket/india-win-champions-trophy-beating-new-zealand-by-four-wickets-final-2025-03-09/?utm_source=openai)
- [India milk 'home' advantage to win Champions Trophy](https://www.reuters.com/sports/cricket/india-need-252-win-champions-trophy-2025-03-09/?utm_source=openai)
- [Rohit hails India spinners, Santner says NZ fell short by 20 runs](https://www.reuters.com/sports/cricket/rohit-hails-india-spinners-santner-says-nz-fell-short-by-20-runs-2025-03-09/?utm_source=openai)

Also for file search, you will need to provide the vector store ID of the vector database managed by OpenAI.

Openai vector store
Source: Link

OpenAI Agents SDK

Building smart AI agents isn’t just about giving them tools and core logic—it’s also about managing how they work together. That’s where OpenAI’s new open-source Agents SDK comes in. It makes it easier for developers to orchestrate multi-agent workflows, improving upon Swarm, an experimental SDK released last year that gained widespread adoption and was successfully deployed by multiple customers.

What’s New?

This is Swarm Agents, it is now production ready. The OpenAI Agents SDK brings several key improvements:

  • Smarter Agents – Easily set up AI models (LLMs) with clear instructions and built-in tools.
  • Seamless Handoffs – Agents can smoothly transfer control between each other when needed.
  • Stronger Guardrails – Built-in safety checks ensure reliable input and output validation.
  • Better Debugging & Insights – Developers can visualize agent execution traces to optimize performance.

With these upgrades, developers can build more efficient, reliable, and scalable AI workflows, making multi-agent collaboration smoother than ever.

OpenAI helps build AI agents by providing key building blocks, including models, tools, memory, guardrails, and orchestration. These components work together, making it easier to create intelligent systems that can understand, reason, and take action.

DOMAINDESCRIPTIONOPENAI PRIMITIVES
ModelsCore intelligence capable of reasoning, making decisions, and processing different modalities.o1o3-miniGPT-4.5GPT-4oGPT-4o-mini
ToolsInterface to the world, interact with environment, function calling, built-in tools, etc.Function callingWeb searchFile searchComputer use
Knowledge & memoryAugment agents with external and persistent knowledge.Vector storesFile searchEmbeddings
GuardrailsPrevent irrelevant, harmful, or undesirable behavior.ModerationInstruction hierarchy
OrchestrationDevelop, deploy, monitor, and improve agents.Agents SDKTracingEvaluationsFine-tuning

Knowledge & Memory

AI agents perform better when they can access knowledge beyond their initial training. OpenAI’s SDK makes this easy by integrating with:

  • Vector stores – Enable fast and efficient semantic search.
  • Embeddings – Improve contextual understanding and dynamic knowledge retrieval.

With these tools, agents can recall important information in real time, making them smarter and more adaptable.

Guardrails

For AI agents to be useful in real-world applications, they must be safe, reliable, and ethical. OpenAI’s SDK provides built-in safeguards, including:

  • Moderation API – Filters out harmful content to ensure user safety.
  • Instruction hierarchy – Follows developer-set priorities to keep agent behavior under control.

These safeguards help ensure AI operates responsibly and remains trustworthy.

Orchestration

Managing AI agents effectively requires strong coordination. OpenAI offers tools to simplify this process:

  • Agent SDK – Streamlines agent development, conversation management, and safety measures.
  • Tracing – Provides real-time monitoring, debugging, and insights into agent behavior.
  • Evaluations – Measures performance and highlights areas for improvement.

With these orchestration tools, developers can build, monitor, and refine AI agents with ease.

Models

MODELAGENTIC STRENGTHS
o1 & o3-miniBest for long-term planning, hard tasks, and reasoning.
GPT-4.5Best for agentic execution.
GPT-4oGood balance of agentic capability and latency.
GPT-4o-miniBest for low-latency.

I have mentioned the tools above!!

How to Use OpenAI Agents SDK?

Step 1: Required Installations

pip install openai --upgrade
pip install openai-agents

Step 2: Add OpenAI API Key

export OPENAI_API_KEY="your-openai-api-key-here"

Step 3: Create an app.py file

touch app.py

Step 4: Add the following code in the app.py file

from agents import Agent, InputGuardrail,GuardrailFunctionOutput, Runner
from pydantic import BaseModel
import asyncio

class HomeworkOutput(BaseModel):
    is_homework: bool
    reasoning: str

guardrail_agent = Agent(
    name="Guardrail check",
    instructions="Check if the user is asking about homework.",
    output_type=HomeworkOutput,
)

math_tutor_agent = Agent(
    name="Math Tutor",
    handoff_description="Specialist agent for math questions",
    instructions="You provide help with math problems. Explain your reasoning at each step and include examples",
)

history_tutor_agent = Agent(
    name="History Tutor",
    handoff_description="Specialist agent for historical questions",
    instructions="You provide assistance with historical queries. Explain important events and context clearly.",
)


async def homework_guardrail(ctx, agent, input_data):
    result = await Runner.run(guardrail_agent, input_data, context=ctx.context)
    final_output = result.final_output_as(HomeworkOutput)
    return GuardrailFunctionOutput(
        output_info=final_output,
        tripwire_triggered=not final_output.is_homework,
    )

triage_agent = Agent(
    name="Triage Agent",
    instructions="You determine which agent to use based on the user's homework question",
    handoffs=[history_tutor_agent, math_tutor_agent],
    input_guardrails=[
        InputGuardrail(guardrail_function=homework_guardrail),
    ],
)

async def main():
    result = await Runner.run(triage_agent, "Explain Pythagoras Theorem")
    print(result.final_output)

    result = await Runner.run(triage_agent, "Give me brief about WWII")
    print(result.final_output)

if __name__ == "__main__":
    asyncio.run(main())

Step 5: Run this command to get the output

python app.py

Output

The Pythagorean Theorem is a fundamental principle in geometry that relates the sides of a right triangle. It states:

\[ a^2 + b^2 = c^2 \]

Here:

- \( c \) is the hypotenuse, the side opposite the right angle.
- \( a \) and \( b \) are the two other sides of the triangle.

### Explanation

1. **Right Triangle:**
- A triangle with one angle equal to 90 degrees.

2. **Hypotenuse:**
- The longest side in a right triangle.

### Steps and Example:

Let's consider a right triangle with sides \( a = 3 \), \( b = 4 \), and \( c \) as the hypotenuse.

**Step 1:** Apply the Pythagorean Theorem
\[ a^2 + b^2 = c^2 \]

**Step 2:** Substitute the known values
\[ 3^2 + 4^2 = c^2 \]

**Step 3:** Calculate the squares
\[ 9 + 16 = c^2 \]

**Step 4:** Sum the squares
\[ 25 = c^2 \]

**Step 5:** Find the square root to solve for \( c \)
\[ c = \sqrt{25} \]
\[ c = 5 \]

Thus, the hypotenuse \( c \) is 5 units long.

### Uses

- **Verification:** It can verify if a triangle is a right triangle.
- **Applications in Real Life:** Architecture, engineering, computer graphics, navigation.

### Example Verification:

Suppose we find a triangle with sides 6, 8, and 10. To verify if it's a right triangle:

**Check:**
\[ 6^2 + 8^2 = 10^2 \]
\[ 36 + 64 = 100 \]
\[ 100 = 100 \]

Since the equation holds true, the triangle is a right triangle.

The Pythagorean Theorem is a powerful tool in mathematics, essential in both theoretical and practical applications.
World War II (1939-1945) was a global conflict involving most of the world's nations, including all great powers, organized into two opposing military alliances: the Allies and the Axis.

### Causes:
1. **Treaty of Versailles**: The harsh terms imposed on Germany after World War I fueled nationalism and resentment.
2. **Expansionist Policies**: Axis powers (Germany, Italy, Japan) sought to expand their territories.
3. **Failure of Appeasement**: Western democracies initially tried to avoid conflict through concessions to Hitler.

### Major Events:
1. **Invasion of Poland (1939)**: Germany's invasion triggered the war.
2. **Fall of France (1940)**: Germany quickly conquered France.
3. **Battle of Britain (1940)**: Britain successfully defended against German air assaults.
4. **Operation Barbarossa (1941)**: German invasion of the Soviet Union marked a crucial phase.
5. **Pearl Harbor (1941)**: Japanese attack brought the United States into the war.
6. **D-Day (1944)**: Allied forces landed in Normandy, France, starting the liberation of Western Europe.
7. **Hiroshima and Nagasaki (1945)**: U.S. dropped atomic bombs on Japan, leading to Japan's surrender.

### Outcomes:
1. **Defeat of Axis Powers**: Germany surrendered in May 1945; Japan in August 1945.
2. **United Nations Founded**: Aimed at preventing future conflicts.
3. **Cold War Onset**: Ideological struggle between the U.S. and the Soviet Union emerged.
4. **Decolonization**: Accelerated end of European colonial empires.

### Impact:
- Major loss of life and destruction.
- Redrawing of international borders.
- Emergence of the U.S. and USSR as superpowers.

World War II stands as one of the most significant events of the 20th century, shaping the modern geopolitical landscape.

It’s a quite straightforward approach, I am looking forward to exploring it more!

Integrated Observability Tools

traces
Source: Link
  1. End-to-End Execution Trace
    • The interface shows a trace log for a multi-step AI-driven process involving different agents.
    • The system displays each agent’s execution time (in milliseconds), enabling developers to pinpoint slow operations.
    • The Triage Agent, Approval Agent, and Summarizer Agent are sequentially involved in handling requests.
  2. Step-by-Step Breakdown
    • The trace log reveals various API calls (POST /v1/responses) and internal function executions.
    • Functions like fetch_data(), check_eligibility(), and send_email() are explicitly logged, showing how the agent interacts with external systems.
  3. Debugging and Performance Analysis
    • Each step has an associated execution time, helping developers identify performance bottlenecks.
    • Some operations, like fetch_data() and check_eligibility(), execute in 0 ms, meaning they are likely optimized or preloaded.
    • Longer steps, such as “Approval Agent” (4,320 ms), suggest areas for performance improvement.
  4. AI Model and Token Usage Monitoring
    • The properties panel provides details about the GPT model version (gpt-40-2024-08-06) and token usage (499 tokens).
    • Monitoring these metrics helps developers optimize token consumption and reduce computational costs.
  5. System Instructions & Workflow Context
    • The bottom panel shows system instructions, detailing how the AI agent processes a claim:
      1. Retrieve claim details.
      2. Check eligibility based on policy.
      3. Approve or reject the claim.
      4. Draft and send an email.
      5. Summarize the claim and decision.
    • This context helps developers understand what the agent is supposed to do and validate its behavior.
logs/traces
Source: OpenAI

Why This Matters for Debugging & Optimization?

  • Traceability: Developers can trace each request and function call to find where issues occur.
  • Performance Monitoring: Execution times help in identifying slow steps that need optimization.
  • Error Detection: If a step fails, logs provide clear insights into where and why the failure happened.
  • Optimization of AI Workflows: Tracking token usage and function calls helps improve efficiency and reduce costs.

The observability tool in the image provides deep visibility into AI agent workflows, allowing developers to trace, inspect, debug, and optimize execution at every step.

Conclusion

OpenAI’s Agent SDK and API updates mark a significant advancement in making AI agent development more efficient, reliable, and scalable. By introducing powerful tools like the Responses API, built-in tools, Agents SDK, and integrated observability tools, OpenAI addresses key challenges that developers face in building production-ready AI agents.

  • The Responses API simplifies agent interactions, combining the power of Chat Completions with tool-use capabilities.
  • Built-in tools (web search, file search, computer use) extend AI capabilities, enabling agents to perform more real-world tasks.
  • The Agents SDK streamlines single and multi-agent workflows, improving orchestration, handoffs, and debugging.
  • Integrated Observability Tools provide end-to-end execution visibility, allowing developers to trace, inspect, and optimize AI workflows with detailed execution logs and performance metrics.

These advancements reduce the complexity of AI agent development, making it easier for developers and enterprises to create intelligent, autonomous, and high-performing AI-driven applications. With further updates on the horizon, OpenAI continues to push the boundaries of AI reliability, efficiency, and usability.

If you want to learn how to build these agents then consider enrolling in our exclusive Agentic AI Pioneer Program!

Hi, I am Pankaj Singh Negi - Senior Content Editor | Passionate about storytelling and crafting compelling narratives that transform ideas into impactful content. I love reading about technology revolutionizing our lifestyle.

Login to continue reading and enjoy expert-curated content.

Responses From Readers

We use cookies essential for this site to function well. Please click to help us improve its usefulness with additional cookies. Learn about our use of cookies in our Privacy Policy & Cookies Policy.

Show details