runResponses() method provides access to OpenAI’s Responses API, designed for reasoning models like o1 and o3-mini.
The Responses API is OpenAI-specific and uses a different input format than
runLocal().When to Use Responses API
UserunResponses() when working with:
- Reasoning models (o1, o3-mini, o4-mini) that benefit from the Responses API format
- Multi-turn conversations where you want to pass output items back as input
- Structured reasoning where you want to capture reasoning summaries
runLocal() instead.
Basic Usage
Input Format
The Responses API uses different roles than the Chat API:Streaming
Enable streaming to receive responses in real-time:Event Types
When streaming, you receive different event types:Multi-Turn Conversations
Pass previous output items back as input for multi-turn conversations:Tool Calling
The Responses API supports function calling:RunResponsesInput
RunResponsesResult
Supported Models
The Responses API works with OpenAI’s reasoning models:Standard models like
gpt-4o can also be used with the Responses API, but runLocal() is recommended for those.
