Introduction
In the OpenAI ecosystem, developers can interact with models through two main APIs: the Responses API and the Chat Completions API. This guide explores the differences, use cases, and how to choose the right API for your project.Overview Comparison
Responses API
- Positioning: The latest core API, an agent-type API primitive
- Features: Combines the simplicity of Chat Completions with more agentic capabilities
- Recommended for: New users
- Built-in tools: Web search, file search, computer use
Chat Completions API
- Positioning: Industry standard for building AI applications
- Features: Stable, widely used
- Future plans: OpenAI plans to support indefinitely
When to Use the Responses API
The Responses API is the latest core API and an agent API primitive that combines the simplicity of chat completions with the ability to perform more agentic tasks. As model capabilities continue to evolve, the Responses API will serve as a flexible foundation for building action-oriented applications with built-in tools:- Web Search: Allow models to search the internet for up-to-date information
- File Search: Enable models to search through uploaded files
- Computer Use: Let models interact with computer interfaces
Key Differences
| Feature | Responses API | Chat Completions API |
|---|---|---|
| Endpoint | POST /v1/responses | POST /v1/chat/completions |
| Input field | input | messages |
| Output format | output array with typed items | choices array with message |
| Built-in tools | Web search, file search, computer use | Function calling only |
| Streaming | SSE with typed events | SSE with data: chunks |
| Reasoning control | reasoning.effort parameter | Not available |
| Model support | All models including o3-pro, codex-mini | Most models |
Migration Guide
To migrate from Chat Completions to Responses API:- Change endpoint from
/v1/chat/completionsto/v1/responses - Rename
messagestoinput - Update response parsing:
choices[0].message.content→output[0].content[0].text - Update streaming event handling to use typed SSE events
