# Create a response (/docs/api/responses)

> For AI agents, the [documentation index](https://bitrouter.ai/llms.txt) lists all pages. Append .md to a documentation URL to read its Markdown.

`POST /v1/responses`

OpenAI Responses format. Send `stream: true` for Server-Sent Events (`response.created`, `response.output_text.delta`, `response.completed`, …). The `x-bitrouter-request-id` response header identifies the request for [settlement](https://bitrouter.ai/docs/api/settlement).

## Authentication

header parameter `x-api-key` or `Authorization: Bearer <token>`.

Base URL: `https://api.spareinference.ai`

## Request body

OpenAI Responses API request.

Media types: `application/json`.

* `input` (required)
* `instructions`: string | null
* `max_output_tokens`: integer | null
* `model`: string
* `parallel_tool_calls`: boolean | null
* `reasoning`
* `store`: boolean | null
* `stream`: boolean
* `temperature`: number | null
* `text`
* `tools`: array
* `top_p`: number | null

## Responses

* `200` Response object (non-streaming). Streamed Responses output — Server-Sent Events with the full output-item lifecycle (`response.created`, `response.output_item.added`, `response.completed`, …). (application/json, text/event-stream)
* `400` Bad request — invalid model or malformed request body. (application/json)
* `402` Payment required — insufficient balance or missing payment proof. (application/json)
* `404` No route found for the requested model. (application/json)
* `429` Rate limited by Spare Inference or by every usable upstream route. Inspect error.code to distinguish rate\_limit\_exceeded from upstream\_rate\_limited; Retry-After is included when known. (application/json)
* `500` Spare Inference internal error. (application/json)
* `502` Upstream returned an invalid response. (application/json)
* `503` The usable upstream route set is temporarily unavailable. (application/json)
* `504` Every usable upstream route timed out. (application/json)

[Full OpenAPI schema](https://bitrouter.ai/openapi.json)