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/responsesRequest body
requiredapplication/jsonmodelstringrequiredTarget model identifier (defined in the panel).
inputstring | ChatMessage[]requiredA 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 propertiesHide properties
One of:
string
stringChatMessage[]
Array of
ChatMessagerolestringrequiredAllowed:
systemuserassistanttoolcontentstringrequiredMessage text. With masking enabled, detected personal-data fields
in all roles (`system`, `user`, `assistant`, `tool`) are replaced
with placeholders inside the gateway.
streambooleandefault: false
temperaturenumbermin 0 · max 2
max_output_tokensintegerMaximum number of tokens to generate.
min 1
Responses
200Successful response
idstringobjectstringcreated_atintegermodelstringstatusstringoutputResponsesOutputItem[]Show propertiesHide properties
Array of
ResponsesOutputItemidstringtypestringstatusstringrolestringcontentResponsesContentPart[]Show propertiesHide properties
Array of
ResponsesContentParttypestringtextstringannotationsobject[]usageUsageShow propertiesHide properties
prompt_tokensintegercompletion_tokensintegertotal_tokensinteger401Missing or invalid virtual key
errorobjectShow propertiesHide properties
messagestringtypestring413The input exceeds the masking limit. The request is not forwarded to
the model; split the text and retry.
errorobjectShow propertiesHide properties
messagestringtypestring429Quota or rate limit exceeded
errorobjectShow propertiesHide properties
messagestringtypestring502The masking step could not run. The request is **fail-closed** and is
not forwarded to the model; there is no "send it unmasked" option.
errorobjectShow propertiesHide properties
messagestringtypestringRequest
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)import requests
response = requests.post(
"https://gw-tr.gurubase.io/v1/responses",
headers={
"Content-Type": "application/json"
},
json={
"model": "gpt-4o-mini",
"input": "Ahmet Yılmaz, TCKN 10000000382, talebini iletti.",
"stream": False,
"temperature": 0,
"max_output_tokens": 0
},
)curl -X POST "https://gw-tr.gurubase.io/v1/responses" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o-mini",
"input": "Ahmet Yılmaz, TCKN 10000000382, talebini iletti.",
"stream": false,
"temperature": 0,
"max_output_tokens": 0
}'const response = await fetch("https://gw-tr.gurubase.io/v1/responses", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"model": "gpt-4o-mini",
"input": "Ahmet Yılmaz, TCKN 10000000382, talebini iletti.",
"stream": false,
"temperature": 0,
"max_output_tokens": 0
})
});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
}
}{
"error": {
"message": "string",
"type": "string"
}
}{
"error": {
"message": "string",
"type": "string"
}
}{
"error": {
"message": "string",
"type": "string"
}
}{
"error": {
"message": "string",
"type": "string"
}
}