Build Hour: Responses API

Quick Overview

The OpenAI Responses API is designed as the flagship API for building AI agents, offering a simplified structure that combines the ease of Chat Completions with enhanced capabilities for multi-step reasoning and tool use, making it more efficient and cost-effective for complex agentic tasks.

Key Points: The Responses API is the new flagship API for building agents, succeeding the older Completions and Chat Completions APIs. The API facilitates an agentic loop, enabling the model to perform multiple steps/tool calls within a single request. It supports built-in tools like web search, file search, computer use, code interpreter, and image generation. The new design preserves the model's chain of thought (reasoning) from request to request, unlike the stateless Chat Completions API. Performance benchmarks show the Responses API is about 20% faster on multi-turn requests than Chat Completions and is generally cheaper due to reduced token usage. Migration from Chat Completions involves updating HTTP endpoints from /v1/chat/completions to /v1/responses and adjusting the message structure (using 'items' instead of 'messages'). The build hour template, including the agent logic, will be made open source on GitHub.

Context: This session, part of OpenAI's 'Build Hours' series, introduces and details the new Responses API, positioned as the successor to the older Completions and Chat Completions APIs, specifically optimized for building complex, stateful AI agents that require multi-step reasoning and tool execution. The presenters explain the architectural shift, highlighting how the new API structure simplifies agent development by providing built-in tools and state persistence, which contrasts with the per-request context management of the previous Chat Completions API.

Detailed Analysis

The presentation announces the Responses API as the successor to the older Completions and Chat Completions APIs, designed specifically to support advanced AI agents. The core advantage is enabling an "agentic loop" where the model can execute multiple steps, including using built-in tools (like web search, file search, code interpreter, and image generation) and performing multi-turn reasoning, all within one request. This stateful approach contrasts with the stateless nature of Chat Completions, where context had to be manually managed across requests. The new API offers better performance (up to 20% faster on multi-turn requests) and cost efficiency because it emits discrete, strongly-typed events (like tool calls, reasoning steps, and final output) instead of streaming raw text deltas. A key feature is the ability to rehydrate a conversation's chain of thought by passing previous response items back into the context, which is crucial for complex reasoning. The presenters show a migration guide and a demo of the OpenAI Simulator, demonstrating how to configure a web search tool within the Agent Builder interface, confirming the new API simplifies the development of complex agentic applications.

Raw markdown version of this recap