OpenAI · Responses
Create Responses with input for supported models and channels.
POST
/v1/responseshttps://api.hanrouter.ai/v1Manage API keysURL and authentication
Use https://api.hanrouter.ai/v1 as the OpenAI-compatible Base URL and Authorization: Bearer $HANROUTER_API_KEY. Do not duplicate /v1. All manufacturers use your HanRouter key, not an upstream vendor key.
For the Anthropic SDK and Claude Code, use https://api.hanrouter.ai without /v1; the client appends /v1/messages. Use the OpenAI-compatible interface for Google models.
Response format
Read messages and output_text blocks in output. Responses streaming events differ from Chat Completions; parse by event type. Both model and channel must support Responses.
Request parameters
model- Required string: exact model ID available to your key.
input- Required: text or an input array allowed by the protocol.
stream- Optional boolean: SSE streaming; default false.
Request example
Examples use configured model IDs. Key group permissions determine access; query GET /v1/models first.
cURL
curl -X POST "https://api.hanrouter.ai/v1/responses" \
-H "Authorization: Bearer $HANROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "your-model-id",
"input": "Hello"
}'Response example
JSON · illustrative structure
{
"object": "response",
"status": "completed",
"output": [
{
"type": "message",
"role": "assistant",
"content": [
{
"type": "output_text",
"text": "Hello!"
}
]
}
]
}