Skip to content
API ReferenceResponses API

API Reference

Responses API

OpenAI's Responses API, served for every chat model on the platform. Use it with the official OpenAI SDKs (client.responses.create), the Agents SDK, Codex and other clients that speak the Responses wire format. Pricing, plan limits and model access are the same as Chat Completions.

POST/v1/responses

Quick example

curl
curl https://api.pawan.krd/v1/responses \ -H "Authorization: Bearer pk-your_key" \ -H "Content-Type: application/json" \ -d '{ "model": "pkrd/cosmosrp-3.5", "instructions": "You are a concise assistant.", "input": "Explain HTTP caching in two sentences." }'
Python (OpenAI SDK)
from openai import OpenAI client = OpenAI(base_url="https://api.pawan.krd/v1", api_key="pk-your_key") first = client.responses.create( model="pkrd/cosmosrp-3.5", input="Give me three names for a coffee shop.", ) print(first.output_text) # Continue the conversation without resending the history second = client.responses.create( model="pkrd/cosmosrp-3.5", previous_response_id=first.id, input="Make them sound more Kurdish.", ) print(second.output_text)

Parameters

modelstringrequired
Model ID. Any chat model on the platform works.
inputstring | arrayrequired
Text, or an array of items: messages (input_text, input_image, input_file with file_data), function_call, function_call_output, custom_tool_call and custom_tool_call_output.
instructionsstring
System / developer instructions for this turn (not inherited through previous_response_id).
previous_response_idstring
Continue from a stored response. Stored responses are kept for 30 days.
storeboolean
Store the response so it can be retrieved and chained. Default: true.
streamboolean
Stream Responses API server-sent events.
toolsarray
function and custom (freeform) tools. Hosted tools (web/file search, code interpreter, computer use, MCP) are not available and are ignored.
tool_choicestring | object
auto, none, required or a specific function.
parallel_tool_callsboolean
Allow several tool calls in one turn.
text.formatobject
Structured output: json_object or json_schema.
reasoning.effortstring
minimal | low | medium | high (reasoning models only).
max_output_tokensinteger
Upper bound on generated tokens.
temperature / top_pnumber
Sampling controls, clamped to the model's ranges.
metadataobject
Up to 16 key/value strings stored with the response.

Function calling

The model returns function_call items. Run the tool and send the result back as a function_call_output item, either with previous_response_id or by resending the full input.

Request with a tool
{ "model": "openai/gpt-oss-20b", "input": "What's the weather in Erbil?", "tools": [ { "type": "function", "name": "get_weather", "description": "Current weather for a city", "parameters": { "type": "object", "properties": { "city": { "type": "string" } }, "required": ["city"] } } ] }
Returning the tool result
{ "model": "openai/gpt-oss-20b", "previous_response_id": "resp_…", "input": [ { "type": "function_call_output", "call_id": "call_…", "output": "{\"temp_c\": 31}" } ] }

Streaming

With stream: true the API sends the standard Responses events, in order:

Event sequence
event: response.created event: response.output_item.added (reasoning / message / function_call) event: response.reasoning_text.delta (reasoning models) event: response.output_text.delta event: response.function_call_arguments.delta event: response.output_item.done event: response.completed (or response.incomplete / response.failed)

Stored responses

GET/v1/responses/{response_id}
GET/v1/responses/{response_id}/input_items
DELETE/v1/responses/{response_id}
POST/v1/responses/input_tokens

Responses are stored for 30 days unless you send store: false. You can only read your own responses. input_tokens counts the prompt size of a request without generating anything (free).

Not supported
background mode, the Conversations API (conversation), prompt templates (prompt) and hosted tools. Requests that need them return a clear 400.