LLM Gatewaydocs

Responses partial

POST/v1/responsessubset — see supported fields
Partial implementation

The gateway supports a subset of the OpenAI Responses API. Requests are mapped to chat completions internally, and responses are re-shaped into the Responses format. Fields not listed below are ignored. Stateful features (previous_response_id, conversations, background mode, built-in tools such as web search or file search) are not supported.

Supported request fields

FieldTypeNotes
modelstring, requiredvendor/name.
inputstring or message array, requiredA plain string becomes a single user message. An array uses the same message shape as Chat Completions (role, content).
instructionsstringPrepended as a system message.
max_output_tokensintegerMapped to max_tokens.
temperaturenumber 0–2
streambooleanEmits Responses-style events, see below.
toolsarrayFunction tools in Responses format ({ type: "function", name, description, parameters }). Mapped to chat tools.
routingobjectRouting override. Stripped before forwarding.

Request

bash
curl "https://api.smartapihub.com/v1/responses" \
  -H "Authorization: Bearer $LLM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-4o-mini",
    "instructions": "Answer in one word.",
    "input": "What colour is the sky on a clear day?"
  }'

Response

json
{
  "id": "resp_01J6ZK…",
  "object": "response",
  "created_at": 1725446400,
  "model": "openai/gpt-4o-mini",
  "provider": "openai",
  "status": "completed",
  "output": [
    {
      "id": "msg_01J6ZK…",
      "type": "message",
      "role": "assistant",
      "status": "completed",
      "content": [{ "type": "output_text", "text": "Blue.", "annotations": [] }]
    }
  ],
  "usage": {
    "input_tokens": 21,
    "output_tokens": 2,
    "total_tokens": 23,
    "x_llm_cost_micro": 4
  }
}

When the model calls a tool, output[] contains an item of type: "function_call" with name, arguments and call_id. Supply the result on the next request as an input item of type: "function_call_output".

Streaming

With "stream": true the gateway emits SSE events in the Responses style. Each event is data: <json> with a type field; the text arrives in response.output_text.delta events.

text
data: {"type":"response.created","response":{"id":"resp_…","object":"response","status":"in_progress","model":"openai/gpt-4o-mini"}}

data: {"type":"response.output_text.delta","item_id":"msg_…","output_index":0,"content_index":0,"delta":"Blue"}

data: {"type":"response.output_text.delta","item_id":"msg_…","output_index":0,"content_index":0,"delta":"."}

data: {"type":"response.completed","response":{"id":"resp_…","object":"response","status":"completed","model":"openai/gpt-4o-mini","provider":"openai","output":[…],"usage":{"input_tokens":21,"output_tokens":2,"total_tokens":23,"x_llm_cost_micro":4}}}

data: [DONE]

Ping comments, mid-stream error chunks and disconnect handling behave exactly as for chat streaming. Response headers are the same as for Chat Completions.

Not supported

previous_response_id, store, background, reasoning, text.format (use chat response_format instead), truncation, include, built-in tools (web_search, file_search, computer_use), GET /v1/responses/{id}, DELETE /v1/responses/{id}. Requests that rely on these will either have the field ignored or receive 400 validation_failed.