Responses
POST /v1/responses takes the same request as OpenAI’s Responses API and works with every chat model in the catalog.
curl https://api.indorouter.ai/v1/responses \ -H "Authorization: Bearer $INDOROUTER_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "openai/gpt-4o-mini", "input": "hello"}'import osfrom openai import OpenAI
client = OpenAI( base_url="https://api.indorouter.ai/v1", api_key=os.environ["INDOROUTER_API_KEY"],)
reply = client.responses.create(model="openai/gpt-4o-mini", input="hello")print(reply.output_text)import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.indorouter.ai/v1", apiKey: process.env.INDOROUTER_API_KEY,});
const reply = await client.responses.create({ model: "openai/gpt-4o-mini", input: "hello" });console.log(reply.output_text);OpenAI and other models
Section titled “OpenAI and other models”OpenAI models receive your request on OpenAI’s own Responses API. For every other vendor we translate the request into a chat request and the answer back into the Responses format. That translation covers:
instructions,inputas a string or asmessageitems,function_callandfunction_call_outputitems, andreasoningitems,- function tools, including tools grouped in a
namespace, max_output_tokens,reasoning.effort,text.formatandtext.verbosity.
On a translated model, hosted tools such as web_search, file_search, code_interpreter and mcp are left out of the request, and include and truncation are ignored. Input that has no chat equivalent, such as an item_reference or a computer_call item, a custom tool type, or tool_choice with allowed_tools, is refused with 400 responses_untranslatable before anything is charged. Adapt the request to the /v1/chat/completions format, or use an OpenAI model that supports the feature.
The rules for fields we refuse, content parts, the output cap and the low-balance cap are the same as on Chat Completions. The cap is max_output_tokens.
Storing a response
Section titled “Storing a response”Responses are not stored unless you send "store": true. A stored response:
- is kept for 30 days from its last change, encrypted,
- belongs to the person the API key was issued to: any of their keys can read it, and a colleague’s keys cannot (a response made with a service key belongs to the account’s service keys),
- is kept only when the request finished.
To continue from a stored response, send its ID as previous_response_id. We send the earlier turns to the model again as input, so every turn is charged for the whole conversation so far.
| Request | What it does |
|---|---|
GET /v1/responses/{id} |
Returns the stored response. An unknown ID, or one that was not stored, gets 404 response_not_found. |
GET /v1/responses/{id}/input_items |
Returns the input items of that request, as a list. |
DELETE /v1/responses/{id} |
Deletes the stored response at once. |
POST /v1/responses/{id}/cancel |
Always refused with 400 responses_not_stored, because background responses do not exist here. |
"background": true is refused with 400 responses_not_stored. Responses are returned through the original request connection.
Conversations
Section titled “Conversations”A conversation object stores the conversation history. Pass its ID as "conversation": "<id>" on POST /v1/responses, and the request’s input and the model’s output are added to it after each answer. A conversation does not need store: true. You cannot use conversation and previous_response_id in the same request.
| Request | What it does |
|---|---|
POST /v1/conversations |
Creates a conversation. The body may carry items and metadata, or be empty. |
GET /v1/conversations/{id} |
Returns the conversation. |
POST /v1/conversations/{id} |
Updates its metadata. |
DELETE /v1/conversations/{id} |
Deletes it. |
GET /v1/conversations/{id}/items |
Lists items, with order (asc or desc) and limit (1 to 100, default 20). There is no cursor for further pages. |
POST /v1/conversations/{id}/items |
Adds items. |
GET /v1/conversations/{id}/items/{item} |
Returns one item. |
DELETE /v1/conversations/{id}/items/{item} |
Deletes one item. |
Conversations follow the same rules as stored responses: encrypted, kept for 30 days from the last change, and readable only with keys of the person who created them. An unknown ID gets 404 conversation_not_found, and an unknown item 404 item_not_found.
Response and streaming
Section titled “Response and streaming”response.id is the request ID (req_...), and response.model is the model ID you sent. A streamed reply is a series of data: {...} events whose type is inside the JSON. It ends with a response.completed or response.incomplete event, which carries the usage. There is no [DONE] line. If the vendor fails after the stream has started, the last event is an {"error": {...}} object.
The response does not include a cost. Pass the response ID to GET /v1/generation to see it.