Responses

POST /v1/responses — OpenAI's newer surface, for the new SDK helpers and agents.

POSThttps://iranrouter.com/v1/responses

OpenAI's Responses API — what client.responses.create and the Agents SDK call. It rides the chat/completions engine: the request is translated in, the answer comes back as a Response object or as this API's stream events. Routing, billing and failover are identical.

Python
from openai import OpenAI

client = OpenAI(api_key="ir-...", base_url="https://iranrouter.com/v1")
resp = client.responses.create(
    model="openai/gpt-4o-mini",
    instructions="کوتاه جواب بده.",
    input="پایتخت ایران کجاست؟",
)
print(resp.output_text)

What is supported

ParameterBehaviour
inputA string, or items: messages with input_text / input_image / input_file parts, and prior function_call / function_call_output turns.
instructionsThe system message.
toolsFunction tools only. Built-in tools (web_search, file_search, …) are refused with a 400, not silently dropped.
tool_choice / parallel_tool_callsSupported.
text.formatjson_object and json_schema (name, schema, strict).
reasoning.effortReaches the reasoning models.
max_output_tokensThe output ceiling; like max_tokens it drives the wallet hold.
streamThis API's SSE events: response.created, output_item.added, output_text.delta, function_call_arguments.delta, … and finally response.completed carrying the whole Response.
previous_response_idNot supported (400 unsupported_parameter): the server keeps no conversation state; send the earlier turns in input.

The response's usage uses this API's names — input_tokens, output_tokens, input_tokens_details.cached_tokens, output_tokens_details.reasoning_tokens — plus cost_rial. status incomplete with incomplete_details.reason = max_output_tokens means the output ceiling was hit.

Idempotency-Key is not honoured on this path; for safe retries use chat/completions.

The same parameters on chat/completions →