POST https://inference-api.openserv.ai/v1/responses
OpenAI Responses format. Use it to receive the reasoning trace alongside the answer. OpenAI models only — other models are not supported on this endpoint. Use chat completions for everything else.
Request
An OpenAI model ID from the catalog, for example gpt-5.4.
The prompt — a string, or an array of input items.
The system prompt. SERV requires one.
Reasoning controls, for example { "effort": "medium", "summary": "auto" }.
Maximum number of tokens to generate.
Function definitions, in OpenAI format.
Stream the response as server-sent events.
All other OpenAI Responses parameters are accepted and forwarded to the model.
Response
Unique identifier for the response.
Convenience field with the generated text.
The full output items, including reasoning items when reasoning is enabled.
Token counts: input_tokens, output_tokens, total_tokens.
curl https://inference-api.openserv.ai/v1/responses \
-H "Authorization: Bearer $SERV_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.4",
"instructions": "You are a careful reasoner.",
"input": "Hello!"
}'
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://inference-api.openserv.ai/v1",
apiKey: process.env.SERV_API_KEY,
});
const response = await client.responses.create({
model: "gpt-5.4",
instructions: "You are a careful reasoner.",
input: "Hello!",
});
{
"id": "resp_...",
"object": "response",
"model": "gpt-5.4",
"output_text": "Hello! How can I help?",
"output": [
{
"type": "message",
"role": "assistant",
"content": [{ "type": "output_text", "text": "Hello! How can I help?" }]
}
],
"usage": { "input_tokens": 16, "output_tokens": 7, "total_tokens": 23 }
}