İçeriğe geç
Gurubase Siper
English
Esc
navigateopen⌘Jpreview

Responses API (OpenAI compatible)

Compatible with OpenAI POST /v1/responses. The input field can be a string or an array of messages; in both forms the content is masked for PII before the model is called. Masking is fail-closed (if the text cannot be masked, the request stops before reaching the model).

POST/v1/responses
Request body
requiredapplication/json
modelstringrequired
Target model identifier (defined in the panel).
inputstring | ChatMessage[]required
A string or an array of messages. In both forms the content is masked inside the gateway before the model is called.
Show properties
One of:
string
string
ChatMessage[]
Array of ChatMessage
rolestringrequired
Allowed:systemuserassistanttool
contentstringrequired
Message text. By default, personal data in the content of all roles (`system`, `user`, `assistant`, `tool`) is masked inside the gateway; only the masked form reaches the model.
streamboolean
default: false
temperaturenumber
min 0 · max 2
max_output_tokensinteger
Maximum number of tokens to generate.
min 1
Responses
200Successful response
idstring
objectstring
created_atinteger
modelstring
statusstring
outputResponsesOutputItem[]
Show properties
Array of ResponsesOutputItem
idstring
typestring
statusstring
rolestring
contentResponsesContentPart[]
Show properties
Array of ResponsesContentPart
typestring
textstring
annotationsobject[]
usageUsage
Show properties
prompt_tokensinteger
completion_tokensinteger
total_tokensinteger
401Missing or invalid virtual key
errorobject
Show properties
messagestring
typestring
429Quota or rate limit exceeded
errorobject
Show properties
messagestring
typestring
Request
from openai import OpenAI

client = OpenAI(
    base_url="https://gw-tr.gurubase.io/v1",
    api_key="SANAL_ANAHTAR",
)

resp = client.responses.create(
    model="gpt-4o-mini",
    input="Ahmet Yılmaz, TCKN 10000000382, adres değişikliği istiyor.",
)
print(resp.output_text)
Response
{
  "id": "resp_01ec5099f62feeda",
  "object": "response",
  "created_at": 1782136928,
  "model": "gpt-4o-mini",
  "status": "completed",
  "output": [
    {
      "id": "msg_01ec5099f62feeda",
      "type": "message",
      "status": "completed",
      "role": "assistant",
      "content": [
        {
          "type": "output_text",
          "text": "Kayıt alındı.",
          "annotations": [
            {}
          ]
        }
      ]
    }
  ],
  "usage": {
    "prompt_tokens": 0,
    "completion_tokens": 0,
    "total_tokens": 0
  }
}