Skip to Content

Create a response

Create a response with the OpenAI Responses API. Send a string or a list of items in input. Set the system prompt with instructions.

  • Continue a conversation with previous_response_id. The server restores its history from responses created with store: true.
  • Set stream: true to receive response events.
  • Set background: true to generate a response asynchronously, then poll or attach later. A background response is stored.
  • Use function tools or text.format with json_schema for structured output.

A response is not stored by default, unlike OpenAI. Send store: true to keep it for 30 days. A max_output_tokens above the output maximum of the model uses that maximum.

POST
/responses

Authorization

headerAuthorizationBearer <token>

Your Munito API key.

Header Parameters

munito-service-tier?string

priority, standard or flex. The response names the tier that is billed; see x-ratelimit-over-limit. See Service tiers.

Default"standard"
Value in"priority""standard""flex"
munito-affinity?string

An opaque token. Send it back with the next request of the conversation, so that the prompt cache can serve it. Without it, the API uses prompt_cache_key, x-session-affinity or user, or metadata.user_id on the Messages API, for the same purpose.

munito-overflow?string

off, model, class or any: what may serve a chat request that its own capacity refuses. The response names the step that served it. Off by default. The request keeps its region, and you pay the price of the model that you asked for. Flex, background and free-tier requests do not overflow.

Default"off"
Value in"off""model""class""any"
munito-prompt-cache-isolation-key?string

A secret string of up to 256 characters. Requests with different keys never share the prompt cache. The body field prompt_cache_isolation_key does the same. See Prompt caching.

Lengthlength <= 256

Request Body

application/json
  1. body
model*string

Model id from GET /models, e.g. qwen/qwen3.8-27b.

input*|array<>

The input: a plain string, or an array of input items (messages, function-call outputs).

instructions?string

System instructions for this response.

previous_response_id?string

Continue from an earlier response. The server replays that conversation state.

store?boolean

Keep the response for 30 days for later retrieval and for previous_response_id.

Defaultfalse
stream?boolean

Stream semantic events back as server-sent events.

Defaultfalse
background?boolean

Generate server-side and return immediately; poll or attach later. A background response is stored, so store: false with background: true answers 400.

Defaultfalse
max_output_tokens?integer

Maximum output tokens to generate, capped at the model's output maximum.

temperature?number

Sampling temperature (0–2).

tools?array<>

OpenAI-style function tools the model may call. A namespace tool groups function tools. The API accepts a hosted web search tool, and the model answers without a search.

prompt_cache_isolation_key?string

A secret key. Requests with different keys never share the prompt cache. See Prompt caching.

Lengthlength <= 256

Response Body

The response object: the same shape that the final response.completed stream event carries.

application/json
curl -X POST 'https://api.munito.ai/inference/v1/responses' \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "qwen/qwen3.8-27b",
  "input": "Summarize the EU AI Act in one paragraph."
}'
Example Response200
{
  "id": "resp_9f41c2d7b3a8",
  "object": "response",
  "status": "completed",
  "model": "qwen/qwen3.8-27b",
  "output": [
    {
      "type": "message",
      "id": "msg_5b1e88a04c21",
      "role": "assistant",
      "status": "completed",
      "content": [
        {
          "type": "output_text",
          "text": "The EU AI Act is the first comprehensive AI law: a risk-based framework that bans a narrow set of unacceptable uses, imposes strict obligations on high-risk systems, adds transparency duties for general-purpose models, and phases in enforcement with fines of up to 7% of global turnover."
        }
      ]
    }
  ],
  "usage": {
    "input_tokens": 12,
    "output_tokens": 42,
    "total_tokens": 54
  },
  "previous_response_id": null,
  "store": true
}