Create Response
OpenAI Responses-compatible endpoint. Mirrors OpenAI's /v1/responses wire format for use with OpenAI-compatible clients such as OpenCode and the AI SDK OpenAI provider.
This route is client-managed for tools: the model may return function call output items, but the server does not execute tools. Your client is responsible for executing tools and sending results back.
- inputrequired
- Type: string
The input messages. An array of message objects following the OpenAI Responses input format.
- Type: stringmodelrequired
The model to use. Use model IDs from
/chat/models(e.g.gpt-5.2,gpt-4o,anthropic.claude-haiku-4-5). - Type: array string[] | null nullableinclude
Accepted for OpenAI/OpenCode compatibility but currently ignored.
- Type: string nullableinstructions
System-level instructions prepended to the conversation.
- Type: integer nullablemax
_output _tokens Maximum number of tokens to generate.
- Type: boolean nullableparallel
_tool _calls Whether the model can make multiple tool calls in parallel.
- nullablereasoning
Accepted for OpenAI/OpenCode compatibility but currently ignored.
- Type: boolean nullablestore
Accepted for OpenAI/OpenCode compatibility but currently ignored.
- Type: booleanstream
Whether to stream the response via Server-Sent Events.
- Type: number nullabletemperature
Sampling temperature (0.0 to 2.0).
- Type: object nullabletext
Text output configuration.
- nullabletool
_choice Controls tool selection. Can be
auto,none,required, or an object specifying a function.
- application/json
- application/json
- application/json
- application/json
- application/json
curl https://ai.hatz.ai/v1/openai/responses \
--request POST \
--header 'Content-Type: application/json' \
--header 'X-API-Key: YOUR_SECRET_TOKEN' \
--data '{
"model": "gpt-5.2",
"input": "",
"instructions": "",
"stream": false,
"temperature": 1,
"top_p": 1,
"max_output_tokens": 1,
"tools": [
{
"type": "function",
"function": {
"name": "",
"description": "",
"parameters": {}
}
}
],
"tool_choice": null,
"parallel_tool_calls": true,
"text": {
"format": {
"type": "text"
}
},
"store": true,
"include": [
""
],
"reasoning": null
}'
{
"id": "resp_abc123def456",
"object": "response",
"created_at": 1,
"status": "completed",
"model": "string",
"output": [
{
"id": "string",
"type": "message",
"role": "string",
"status": "string",
"content": [
{
"type": "string",
"text": "string",
"annotations": [
{}
]
}
],
"call_id": "string",
"name": "string",
"arguments": "string"
}
],
"output_text": "string",
"usage": {
"input_tokens": 1,
"output_tokens": 1,
"total_tokens": 1
},
"incomplete_details": {
"reason": "string"
}
}