Create Responses Request (openai)
Text Series
Create Responses Request (openai)
POST
Create Responses Request (openai)
Introduction
The Responses API is OpenAI’s next-generation conversation interface, designed specifically for reasoning models (o-series, GPT-5 series) and advanced features. Compared to the traditional Chat Completions API, the Responses API offers more granular reasoning control, built-in tool support, and multimodal input capabilities.Use Cases
- Reasoning-intensive tasks: Use o1, o3-mini, o4-mini, GPT-5 and other reasoning models
- Web search requirements: Built-in Web Search Preview tool
- Advanced tool calling: Supports Function Call and Custom Tool Call
- Multi-turn conversation continuation: Conversation history management via
previous_response_id
Authentication
Bearer Token, e.g.,
Bearer sk-xxxxxxxxxxRequest Parameters
Model identifier, supported models include:
- GPT-5 series:
gpt-5.2,gpt-5,gpt-5-mini, etc. - o series:
o1,o3-mini,o4-mini, etc. - GPT-4 series:
gpt-4o,gpt-4.1,gpt-4o-mini, etc.
Input message list, supports multiple formats:
- Simplified format:
[{"role": "user", "content": "text"}](similar to Chat Completions) - Standard format:
[{"type": "input_text", "text": "text"}] - Multimodal: Supports
input_image,input_filetypes
System instructions, equivalent to system message in Chat Completions
Maximum output token count, controls response length
Whether to enable streaming output, returns SSE format chunk data
Randomness control, 0-2, higher values make responses more random
Nucleus sampling parameter, 0-1, controls generation diversity
Reasoning configuration for controlling reasoning model behavior:
effort: Reasoning effort, options:"none","low","medium","high"summary: Reasoning summary, options:"auto","none","detailed"
Tool list, supports three types:
- Built-in Web Search:
{"type": "web_search_preview", "search_context_size": "medium"} - Built-in File Search:
{"type": "file_search"} - Custom Functions: Standard OpenAI Function Call format
Tool selection strategy:
"auto": Model automatically decides whether to call tools"none": Disable tool calling{"type": "function", "function": {"name": "function_name"}}: Force call specific function
Whether to allow parallel multiple tool calls
Maximum tool call limit
Previous response ID for conversation continuation
Truncation strategy:
"auto" or "disabled"Request metadata for tracking and debugging
User identifier
Basic Examples
- Simple Conversation (Non-streaming)
- Simple Conversation (Streaming)
- Python SDK
Response Format
Non-streaming Response
Streaming Response (SSE Events)
Streaming responses use Server-Sent Events format with the following event types:| Event Type | Description |
|---|---|
response.created | Response created |
response.in_progress | Response in progress |
response.output_item.added | Output item added (tool call started) |
response.output_text.delta | Text delta |
response.output_text.done | Text completed |
response.output_item.done | Output item completed |
response.completed | Response completed |
Advanced Features
1. Web Search
Enable built-in Web Search tool for real-time internet information retrieval.- Basic Example
- Advanced Configuration
-
search_context_size: Search context size"low": Low context, faster but fewer results"medium": Medium context (default)"high": High context, more search results but slower
-
user_location(optional): User location informationcountry: Country code (e.g., “US”, “CN”)region: State/Provincecity: Citytimezone: Timezone
2. Reasoning Control
Control reasoning depth and output format for reasoning models.- Auto Reasoning Summary
- Detailed Reasoning
-
effort: Reasoning effort level"none": No reasoning"low": Light reasoning"medium": Medium reasoning (default)"high": Deep reasoning
-
summary: Reasoning summary"none": No reasoning summary"auto": Automatically decide whether to output summary"detailed": Output detailed reasoning process
3. Custom Function Calling
Supports standard OpenAI Function Calling format.4. Multimodal Input
Supports text, image, file and other input types.- Image Input
- File Input
5. Conversation Continuation
Useprevious_response_id to continue previous conversations.
Important Notes
Comparison: Responses API vs Chat Completions API
| Feature | Responses API | Chat Completions API |
|---|---|---|
| Reasoning Model Support | ✅ Full support | ⚠️ Limited support |
| Built-in Web Search | ✅ Native support | ❌ Not supported |
| Reasoning Control | ✅ Fine-grained control | ❌ Not supported |
| Conversation Continuation | ✅ previous_response_id | ✅ Via messages |
| Streaming Output | ✅ SSE format | ✅ SSE format |
| Client Compatibility | ⚠️ Needs adaptation | ✅ Standard format |
| Use Cases | Reasoning, search, advanced features | General conversation |
Related Resources
Chat Completions API
Standard conversation interface documentation
Model List
View all supported models
FAQ
Responses API FAQs
