DocsAPI reference
Responses
POST /v1/responses — OpenAI's Responses API, served natively by vLLM, used by Codex CLI and the newer OpenAI SDK helpers.
POST https://osarai.xyz/v1/responsesOpenAI's Responses API takes input instead of messages and returns typed output items. Your instance's vLLM serves it natively. It works best with gpt-oss models, for which it is the reference format; with Qwen3.8 prefer Chat Completions for tool calls.
Request
curl "https://osarai.xyz/v1/responses" \
-H "Authorization: Bearer $OSARAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-oss-20b",
"instructions": "You are a concise assistant.",
"input": "What is a KV cache?",
"reasoning": {"effort": "low"}
}'from openai import OpenAI
import os
client = OpenAI(base_url="https://osarai.xyz/v1", api_key=os.environ["OSARAI_API_KEY"])
response = client.responses.create(
model="gpt-oss-20b",
instructions="You are a concise assistant.",
input="What is a KV cache?",
reasoning={"effort": "low"},
)
print(response.output_text)import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://osarai.xyz/v1", apiKey: process.env.OSARAI_API_KEY });
const response = await client.responses.create({
model: "gpt-oss-20b",
instructions: "You are a concise assistant.",
input: "What is a KV cache?",
reasoning: { effort: "low" },
});
console.log(response.output_text);| Field | Notes |
|---|---|
model | Your instance's model id |
input | A string, or a list of input items (messages, function call outputs) |
instructions | System instructions |
max_output_tokens | Capped at the model's max output; on your own instance, unset means no extra cap |
reasoning.effort | low, medium or high |
tools | Function tools ({"type": "function", "name": …, "parameters": …}) |
stream | Stream typed events (response.output_text.delta, response.completed, …) |
temperature, top_p | Sampling |
Hosted OpenAI tools (web search, file search, code interpreter) and stored conversations (previous_response_id across instances) are not available: each request runs on your instance alone, so send the whole conversation in input.
Response
{
"id": "resp_6a1f0c2e9b",
"object": "response",
"model": "gpt-oss-20b",
"status": "completed",
"output": [
{ "type": "reasoning", "summary": [], "content": [{ "type": "reasoning_text", "text": "Explain briefly…" }] },
{
"type": "message",
"role": "assistant",
"content": [{ "type": "output_text", "text": "A KV cache stores the attention keys and values…" }]
}
],
"usage": { "input_tokens": 30, "output_tokens": 96, "total_tokens": 126 }
}The SDKs' output_text joins the text parts for you.
Used by
Codex CLI speaks only this API to custom providers. Zed can use it per model by turning off chat_completions in the model's capabilities.