Responses
curl --request POST \
--url https://openp.ai/v1/responsesimport requests
url = "https://openp.ai/v1/responses"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://openp.ai/v1/responses', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://openp.ai/v1/responses",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://openp.ai/v1/responses"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://openp.ai/v1/responses")
.asString();require 'uri'
require 'net/http'
url = URI("https://openp.ai/v1/responses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyOpenAI-compatible
Responses
POST /v1/responses — OpenAI’s newer unified response endpoint
POST
/
v1
/
responses
Responses
curl --request POST \
--url https://openp.ai/v1/responsesimport requests
url = "https://openp.ai/v1/responses"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://openp.ai/v1/responses', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://openp.ai/v1/responses",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://openp.ai/v1/responses"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://openp.ai/v1/responses")
.asString();require 'uri'
require 'net/http'
url = URI("https://openp.ai/v1/responses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body/v1/responses is OpenAI’s newer endpoint that manages multi-step conversations and tool calls with a unified response object, suited to agent scenarios.
OpenAI now positions the Responses API as the recommended default interface — prefer it for new projects; Chat Completions remains supported long-term with backward compatibility.
Differences from chat/completions
| Dimension | /v1/chat/completions | /v1/responses |
|---|---|---|
| Input | messages array | input (a string, message array, or previous_response_id) |
| State | Stateless, full history sent each time | Optionally stateful (store: true) |
| Tools | tools + tool_calls | Built-in web_search, file_search, code_interpreter |
| Model scope | All models | Mainly newer OpenAI models |
Request
curl https://openp.ai/v1/responses \
-H "Authorization: Bearer $OPENPAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.5",
"input": "Introduce OpenPAI in 200 words"
}'
Main parameters
| Field | Type | Description |
|---|---|---|
model | string | Model ID |
input | string | array | Input content, plain text or a multimodal array |
instructions | string | Equivalent to a system prompt |
previous_response_id | string | Continue from a previous response without resending history |
tools | array | Built-in tools or custom functions |
tool_choice | string | object | Tool selection strategy |
stream | boolean | Streaming output |
store | boolean | Whether to save conversation state server-side |
temperature / top_p | number | Sampling parameters |
max_output_tokens | integer | Maximum output tokens |
reasoning | object | { effort: "high" } reasoning effort |
metadata | object | Business labels |
user | string | End-user identifier |
Response
{
"id": "resp_...",
"object": "response",
"created_at": 1715750400,
"status": "completed",
"model": "gpt-5.5",
"output": [
{
"type": "message",
"role": "assistant",
"content": [{"type": "output_text", "text": "OpenPAI is a..."}]
}
],
"usage": {
"input_tokens": 12,
"output_tokens": 48,
"total_tokens": 60,
"input_tokens_details": { "cached_tokens": 0 },
"output_tokens_details": { "reasoning_tokens": 0 }
}
}
response.output_text (an SDK helper field).
Multi-turn conversation
The second turn doesn’t resend history — useprevious_response_id:
{
"model": "gpt-5.5",
"previous_response_id": "resp_...",
"input": "Expand on point 2"
}
store: true in the first request so OpenPAI retains the state.
Reasoning
{
"model": "o3-mini",
"input": "Prove that √2 is irrational",
"reasoning": { "effort": "high" },
"max_output_tokens": 4096
}
Built-in tools
{
"model": "gpt-5.5",
"input": "Latest OpenPAI news",
"tools": [{ "type": "web_search" }]
}
web_search— search the webfile_search— retrieve from uploaded filescode_interpreter— execute code in a sandbox