Skip to content

Responses

POST /v1/responses takes the same request as OpenAI’s Responses API and works with every chat model in the catalog.

Terminal window
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"}'

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, input as a string or as message items, function_call and function_call_output items, and reasoning items,
  • function tools, including tools grouped in a namespace,
  • max_output_tokens, reasoning.effort, text.format and text.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.

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.

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.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.