Skip to main content
POST
/
v1
/
responses
Responses
curl --request POST \
  --url https://openp.ai/v1/responses
import 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
Inputmessages arrayinput (a string, message array, or previous_response_id)
StateStateless, full history sent each timeOptionally stateful (store: true)
Toolstools + tool_callsBuilt-in web_search, file_search, code_interpreter
Model scopeAll modelsMainly 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

FieldTypeDescription
modelstringModel ID
inputstring | arrayInput content, plain text or a multimodal array
instructionsstringEquivalent to a system prompt
previous_response_idstringContinue from a previous response without resending history
toolsarrayBuilt-in tools or custom functions
tool_choicestring | objectTool selection strategy
streambooleanStreaming output
storebooleanWhether to save conversation state server-side
temperature / top_pnumberSampling parameters
max_output_tokensintegerMaximum output tokens
reasoningobject{ effort: "high" } reasoning effort
metadataobjectBusiness labels
userstringEnd-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 }
  }
}
You can get the merged text directly via response.output_text (an SDK helper field).

Multi-turn conversation

The second turn doesn’t resend history — use previous_response_id:
{
  "model": "gpt-5.5",
  "previous_response_id": "resp_...",
  "input": "Expand on point 2"
}
You must pass 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" }]
}
Supported built-in tools (subject to upstream availability):
  • web_search — search the web
  • file_search — retrieve from uploaded files
  • code_interpreter — execute code in a sandbox
Some built-in tools depend on the upstream environment; OpenPAI passes the results through.