---
title: "OpenAI-compatible Responses"
method: POST
path: "/api/v3/inference/responses"
tags: ["Inference"]
---

# OpenAI-compatible Responses

`POST /api/v3/inference/responses`

## Request

- Base URL: `https://api.nugen.in`
- URL: `https://api.nugen.in/api/v3/inference/responses`
- Auth: HTTP bearer

OpenAI `responses.create` compatible endpoint.

Accepts the same shape as `openai.responses.create` and returns a `Response` object.


**Request Body:**

- `model`: Model ID (required)
- `input`: User input a plain string or array of `{"role": ..., "content": ...}` dicts
- `instructions` (optional): System-level instructions
- `max_output_tokens` (optional): Maximum tokens to generate
- `temperature` (optional): Sampling temperature 0–2 (default: 1.0)
- `top_p` (optional): Nucleus sampling parameter
- `stream` (optional): Stream partial output as SSE (default: true). Set `stream: false` for one JSON response.

**Example Request:**

```json
POST /api/v3/inference/responses
Headers: {"Authorization": "Bearer <api_key>"}

{
  "model": "Qwen/Qwen2.5-0.5B-Instruct",
  "input": "What is the capital of France?",
  "instructions": "You are a helpful assistant.",
  "max_output_tokens": 200,
  "stream": false
}
```

**Example Response:**

```json
{
  "id": "resp_abc123",
  "object": "response",
  "created_at": 1704123600,
  "model": "Qwen/Qwen2.5-0.5B-Instruct",
  "output": [
    {
      "type": "message",
      "role": "assistant",
      "content": [{"type": "output_text", "text": "The capital of France is Paris."}]
    }
  ],
  "usage": {"input_tokens": 18, "output_tokens": 9, "total_tokens": 27}
}
```

## Request body

- ResponsesCreateRequest: A request in the Responses format.
  - `model` string, required: Model ID to use for the response
  - `input` union, required: Input text or array of message dicts
    - string
    - object[]
  - `instructions` string, nullable: System-level instructions (maps to system message)
  - `max_output_tokens` integer, nullable: Maximum tokens to generate
  - `temperature` number, nullable: Sampling temperature
  - `top_p` number, nullable: Nucleus sampling parameter
  - `stream` boolean, nullable: Stream partial output as server-sent events. Defaults to true. Set false for one JSON response.
  - `metadata` object, nullable: Optional metadata, ignored by the model

## Response `200`

Successful Response

- ResponsesCreateResponse: A response in the Responses format.
  - `id` string, required: Unique identifier of the response
  - `object` 'response': Always "response".
  - `created_at` integer, required: Unix time in seconds when the response was created
  - `model` string, required: Model used for the response
  - `output` ResponsesOutputMessage[], required: Generated output messages
    - `type` 'message': Always "message".
    - `role` 'assistant': Always "assistant".
    - `content` ResponsesOutputText[], required: Generated content parts
      - `type` 'output_text': Always "output_text".
      - `text` string, required: Generated text
  - `usage` ResponsesUsage, required: Token counts for a response.
    - `input_tokens` integer, required: Tokens in the input
    - `output_tokens` integer, required: Tokens generated
    - `total_tokens` integer, required: Input plus output tokens

## Other responses

- `401`: Invalid API key
- `403`: Authorization header missing or not a Bearer token
- `422`: Validation Error

---

[API](https://skmtc.dev/nugen/apis/nugen-intelligence-api.md) - [All operations](https://skmtc.dev/nugen/apis/nugen-intelligence-api/llms.txt) - [OpenAPI document](https://skmtc.dev/nugen/apis/nugen-intelligence-api/revisions/62baa7960a4a?raw)
