Responses API
7/28/26About 2 min
Responses API
The Responses API is OpenAI's next-generation interface for interacting with language models. It supports multi-turn conversations via previous_response_id, stateful interactions, and built-in tool calling.
Endpoint Info
| Item | Value |
|---|---|
| URL | /v1/responses |
| Method | POST |
| Auth | Bearer Token (API Key) |
| Content-Type | application/json |
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model ID, e.g. gpt-4o-mini |
input | string / array | Yes | Input text or message array |
instructions | string | No | System-level instructions for the model |
previous_response_id | string | No | ID of a previous response for multi-turn context |
max_output_tokens | integer | No | Maximum number of output tokens |
temperature | number | No | Sampling temperature, 0–2. Default 1 |
top_p | number | No | Nucleus sampling, 0–1 |
stream | boolean | No | Enable streaming output. Default false |
tools | array | No | Tool definitions for function calling |
tool_choice | string/object | No | Tool selection mode: auto, none, or specific tool |
cURL Examples
Normal Request
curl https://api.quickapi.store/v1/responses \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "gpt-4o-mini",
"input": "What is the capital of France?",
"max_output_tokens": 1000
}'Streaming Request
curl https://api.quickapi.store/v1/responses \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "gpt-4o-mini",
"input": "Tell me a short story",
"stream": true
}'With Instructions
curl https://api.quickapi.store/v1/responses \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "gpt-4o",
"input": "Explain quantum computing",
"instructions": "You are a physics professor. Explain concepts clearly.",
"max_output_tokens": 2000
}'Multi-turn with previous_response_id
curl https://api.quickapi.store/v1/responses \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "gpt-4o-mini",
"input": "And what is its population?",
"previous_response_id": "resp_abc123def456"
}'💡 Multi-turn Conversations
Use previous_response_id to chain responses. The model retains the full conversation context from prior turns, enabling natural multi-turn dialogue without resending the entire history.
Response Example
Normal Response
{
"id": "resp_abc123def456",
"object": "response",
"created_at": 1700000000,
"model": "gpt-4o-mini",
"output": [
{
"type": "message",
"role": "assistant",
"content": [
{
"type": "output_text",
"text": "The capital of France is Paris."
}
]
}
],
"usage": {
"input_tokens": 12,
"output_tokens": 8,
"total_tokens": 20
}
}Streaming Response
data: {"type":"response.output_text.delta","delta":"The"}
data: {"type":"response.output_text.delta","delta":" capital"}
data: {"type":"response.output_text.delta","delta":" of"}
data: {"type":"response.output_text.delta","delta":" France"}
data: {"type":"response.output_text.delta","delta":" is"}
data: {"type":"response.output_text.delta","delta":" Paris."}
data: {"type":"response.completed","response":{"id":"resp_abc123def456","output":[{"type":"message","role":"assistant","content":[{"type":"output_text","text":"The capital of France is Paris."}]}]}}
data: [DONE]Python Example
from openai import OpenAI
client = OpenAI(
base_url="https://api.quickapi.store/v1",
api_key="YOUR_API_KEY"
)
# Normal request
response = client.responses.create(
model="gpt-4o-mini",
input="What is the capital of France?"
)
print(response.output[0].content[0].text)
# Streaming request
for event in client.responses.create(
model="gpt-4o-mini",
input="Tell me a short story",
stream=True
):
if hasattr(event, 'delta'):
print(event.delta, end="")
# Multi-turn conversation
first = client.responses.create(
model="gpt-4o-mini",
input="What is the capital of France?"
)
second = client.responses.create(
model="gpt-4o-mini",
input="And what is its population?",
previous_response_id=first.id
)
print(second.output[0].content[0].text)⚠️ API Compatibility
The Responses API is OpenAI's newest interface. Ensure your SDK version supports client.responses.create(). Older SDK versions may not include this endpoint.

