Responses
POST /v1/responsesUse the model name shown on the Pricing page.
Authentication
Section titled “Authentication”Authorization: Bearer OMROUTER_API_KEYContent-Type: application/jsonRequest body
Section titled “Request body”| Field | Type | Required | Description |
|---|---|---|---|
model |
string | Yes | Model name shown on the Pricing page. |
input |
string or array | Yes | Text or structured input items. |
instructions |
string or object | No | Overall instructions for the model. |
max_output_tokens |
integer | No | Maximum output tokens where supported. |
stream |
boolean | No | Stream response events when true. |
tools |
array | No | Tools supported by the selected model and route. |
tool_choice |
string or object | No | Tool selection control where supported. |
reasoning |
object | No | Reasoning configuration where supported. |
previous_response_id |
string | No | Continue a compatible previous response. |
Example
Section titled “Example”curl --silent --show-error \ 'https://omrouter.com/v1/responses' \ --header "Authorization: Bearer $OMROUTER_API_KEY" \ --header 'Content-Type: application/json' \ --data "{ \"model\": \"$OMROUTER_MODEL_ID\", \"input\": \"Reply with one short sentence.\" }"Response
Section titled “Response”Generated content is in the output array. OpenAI SDKs usually also provide a direct way to read the output text.
{ "id": "resp_...", "object": "response", "status": "completed", "model": "model-id", "output": [ { "type": "message", "role": "assistant", "content": [ {"type": "output_text", "text": "..."} ] } ], "usage": {}}The content of output changes with the request type and model.
Compact responses
Section titled “Compact responses”POST /v1/responses/compact is for clients that explicitly support Compact Responses. Normal Responses clients should continue to use /v1/responses.
Optional features
Section titled “Optional features”Tools, reasoning, prompt caching, storage, and continuation depend on the selected model. If the API reports an unsupported parameter, remove that optional field and try again.