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.

Body
required
application/json
  • input
    required
    • Type: string

      The input messages. An array of message objects following the OpenAI Responses input format.

  • model
    Type: string
    required

    The model to use. Use model IDs from /chat/models (e.g. gpt-5.2, gpt-4o, anthropic.claude-haiku-4-5).

  • include
    Type: array string[] | null nullable

    Accepted for OpenAI/OpenCode compatibility but currently ignored.

  • instructions
    Type: string nullable

    System-level instructions prepended to the conversation.

  • max_output_tokens
    Type: integer nullable

    Maximum number of tokens to generate.

  • parallel_tool_calls
    Type: boolean nullable

    Whether the model can make multiple tool calls in parallel.

  • reasoning
    nullable

    Accepted for OpenAI/OpenCode compatibility but currently ignored.

  • store
    Type: boolean nullable

    Accepted for OpenAI/OpenCode compatibility but currently ignored.

  • stream
    Type: boolean

    Whether to stream the response via Server-Sent Events.

  • temperature
    Type: number nullable

    Sampling temperature (0.0 to 2.0).

  • text
    Type: object nullable

    Text output configuration.

  • tool_choice
    nullable

    Controls tool selection. Can be auto, none, required, or an object specifying a function.

Responses
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
Request Example for post/openai/responses
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"
  }
}