İç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. With masking enabled, detected PII fields in either form are replaced before the model call. If the masking step cannot run, the request stops fail-closed before the model call.

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. With masking enabled, detected personal-data fields in either form are replaced inside the gateway before the model call.
Show properties
One of:
string
string
ChatMessage[]
Array of ChatMessage
rolestringrequired
Allowed:systemuserassistanttool
contentstringrequired
Message text. With masking enabled, detected personal-data fields in all roles (`system`, `user`, `assistant`, `tool`) are replaced with placeholders inside the gateway.
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
413The input exceeds the masking limit. The request is not forwarded to the model; split the text and retry.
errorobject
Show properties
messagestring
typestring
429Quota or rate limit exceeded
errorobject
Show properties
messagestring
typestring
502The masking step could not run. The request is **fail-closed** and is not forwarded to the model; there is no "send it unmasked" option.
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
  }
}