> ## Documentation Index
> Fetch the complete documentation index at: https://docs.openserv.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Responses

> POST /v1/responses — OpenAI Responses format, with streamed reasoning summaries.

```
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](./chat-completions) for everything else.

## Request

<ParamField header="Authorization" type="string" required>
  `Bearer $SERV_API_KEY`.
</ParamField>

<ParamField body="model" type="string" required>
  An OpenAI model ID from the [catalog](../models), for example `gpt-5.4`.
</ParamField>

<ParamField body="input" type="string | array" required>
  The prompt — a string, or an array of input items.
</ParamField>

<ParamField body="instructions" type="string" required>
  The system prompt. SERV requires one.
</ParamField>

<ParamField body="reasoning" type="object">
  Reasoning controls, for example `{ "effort": "medium", "summary": "auto" }`.
</ParamField>

<ParamField body="max_output_tokens" type="integer">
  Maximum number of tokens to generate.
</ParamField>

<ParamField body="tools" type="array">
  Function definitions, in OpenAI format.
</ParamField>

<ParamField body="stream" type="boolean" default="false">
  Stream the response as server-sent events.
</ParamField>

All other OpenAI Responses parameters are accepted and forwarded to the model.

## Response

<ResponseField name="id" type="string">
  Unique identifier for the response.
</ResponseField>

<ResponseField name="object" type="string">
  Always `"response"`.
</ResponseField>

<ResponseField name="model" type="string">
  The model used.
</ResponseField>

<ResponseField name="output_text" type="string">
  Convenience field with the generated text.
</ResponseField>

<ResponseField name="output" type="array">
  The full output items, including reasoning items when reasoning is enabled.
</ResponseField>

<ResponseField name="usage" type="object">
  Token counts: `input_tokens`, `output_tokens`, `total_tokens`.
</ResponseField>

<RequestExample>
  ```bash curl theme={null}
  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!"
    }'
  ```

  ```js OpenAI SDK theme={null}
  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!",
  });
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "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 }
  }
  ```
</ResponseExample>
