Skip to content

Responses

POST /v1/responses

Use the model name shown on the Pricing page.

Authorization: Bearer OMROUTER_API_KEY
Content-Type: application/json
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.
Terminal window
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.\"
}"

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.

POST /v1/responses/compact is for clients that explicitly support Compact Responses. Normal Responses clients should continue to use /v1/responses.

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.