OpenAI Responses API Explained: The New Way to Build AI Agents
The OpenAI Responses API is the agent-native endpoint: one call, typed output items, stored state, and built-in tools. Tools, pricing, and how it differs.
By Galactic News Editorial · Published 2026-11-20T22:33:27+00:00 · Updated 2026-11-20T22:33:27+00:00
OpenAI Responses API Explained: The New Way to Build AI Agents
The OpenAI Responses API is the company's agent-oriented API. One endpoint, POST /v1/responses, returns a stored response object that can carry text, images, function calls, and results from built-in tools. It launched on March 11, 2025. OpenAI calls it the new API primitive, and it is where new agent features ship first.
If you build AI agents, this is the API to learn. Chat Completions still works for simple text generation. Responses is for anything that needs tools, memory across turns, or multi-step reasoning.
OpenAI Responses API Explained
A Responses request needs two things: a model and an input. Input accepts a plain string or a list of typed items, including text, images, files, and audio. The response object contains an id, an output list, an output_text convenience field, usage data, and metadata about any tools that ran.
The output list is the key difference from Chat Completions. Where Chat Completions returns one message, Responses returns typed items in the order they happened: message, reasoning, function_call, web_search_call, file_search_call, code_interpreter_call, and image_generation_call. Each step the model took is visible as its own item.
Responses are stored server-side by default. To continue a conversation, pass the previous response id as previous_response_id. The model keeps its reasoning state across turns, which improves accuracy on multi-step tasks. You can also build your own state by passing the full item list back in.
How It Differs From Chat Completions
| Capability | Chat Completions | Responses API |
|---|---|---|
| Endpoint | POST /v1/chat/completions | POST /v1/responses |
| Output shape | One message | Typed output item list |
| Built-in tools | Limited | Web search, file search, code interpreter, computer use, image generation, remote MCP |
| Multi-turn state | You manage it | Stored responses, pass previous_response_id |
| Reasoning items | Not exposed | Reasoning summaries available |
| Agentic loop | Manual | Built in: multiple tools per request |
Migration has three parts: send requests to /v1/responses, read output from the typed output array, and choose how to carry state between turns. The SDKs expose an output_text helper that Chat Completions lacks.
Built-In Tools
Responses ships hosted tools. You list them in the tools array. The model decides when to call them, and OpenAI runs them server-side.
- Web search. Real-time search with citations. Results return as web_search_call items with url_citation annotations. OpenAI's terms require those citations to stay visible when you show searched content to users.
- File search. Semantic search across documents in a vector store. Upload files, attach the store, and the model retrieves chunks on its own.
- Code interpreter. A sandboxed Python environment. The model writes code, runs it, reads the output, and retries when the first attempt fails. It can produce charts and CSV files.
- Computer use. The model operates a virtual desktop with a mouse and keyboard.
- Image generation. The gpt-image-1 model runs as a tool inside Responses, with streaming previews and multi-turn refinement.
- Remote MCP. Added in May 2025, alongside native image generation, code interpreter, and background mode. Connect a remote MCP server and its tools become callable.
Your own functions work the same way. List them as function tools, and the model returns function_call items. Your code runs the function and returns a function_call_output item. One request can mix hosted tools and your own functions freely.
Pricing: What Each Tool Costs
Model tokens bill at standard API rates. Hosted tools add their own fees on top. These rates come from OpenAI's pricing page.
| Tool | Price |
|---|---|
| Web search | $10 per 1,000 calls, plus search content tokens at model rates |
| File search | $2.50 per 1,000 calls; storage $0.10 per GB per day, first 1 GB free |
| Code interpreter / hosted shell | $0.03 to $1.92 per 20-minute session, by container size |
| Computer use | No separate fee; screenshots bill as image input |
Watch for multi-call behavior. One /v1/responses request can trigger two or three billable web searches. Budget for that when you estimate costs.
A Minimal First Request
- Install the SDK. Run pip install --upgrade openai. You need Python 3.9 or newer.
- Send a plain request. Call client.responses.create with a model and an input string. Read response.output_text.
- Add a tool. Pass tools with a web_search entry and ask a time-sensitive question. Inspect the web_search_call item in response.output.
- Chain a turn. Pass the first response id as previous_response_id in the next call. The model continues with context intact.
- Add your own function. Define a function tool, handle the function_call item in your code, and return the result as function_call_output.
Steer tool choice with tool_choice: auto by default, required to force a call, or allowed_tools to restrict the model to a named subset.
Bottom Line
Responses is OpenAI's agent primitive: one endpoint, typed output items, stored state, and hosted tools in a single call. Use Chat Completions for simple text. Use Responses the moment your app needs search, files, code, or multi-step tool use. Start with a plain request, add one tool, and watch the output items before you build the full loop.