OpenAI Responses

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.

post/openai/responses

Request

  • Base URL: https://ai.hatz.ai/v1
  • URL: https://ai.hatz.ai/v1/openai/responses
  • Auth: one of:
    • API key in header X-API-Key
    • HTTP bearer

Request body

modelstring required

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

instructionsstring nullable

System-level instructions prepended to the conversation.

streamboolean

Whether to stream the response via Server-Sent Events.

temperaturenumber nullable

Sampling temperature (0.0 to 2.0).

top_pnumber nullable

Nucleus sampling parameter.

max_output_tokensinteger nullable

Maximum number of tokens to generate.

tool_choiceunknown
parallel_tool_callsboolean nullable

Whether the model can make multiple tool calls in parallel.

storeboolean nullable

Accepted for OpenAI/OpenCode compatibility but currently ignored.

includestring[] nullable

Accepted for OpenAI/OpenCode compatibility but currently ignored.

reasoningunknown

Example request

{
  "model": "gpt-5.2"
}

Response

Successful response. Returns an OpenAI Responses-format object when stream is false, or a stream of Server-Sent Events when stream is true.

idstring

Unique response identifier (e.g. resp_...).

object'response'

The object type.

created_atinteger

Unix timestamp of when the response was created.

status'completed' | 'incomplete'

Whether the response completed successfully.

modelstring

The model used.

output_textstring

Convenience field with the full assistant text output.

Example response

{
  "id": "resp_abc123def456"
}

Changes

No recorded changes to this operation across all 1 revision of this API.