Safety Guardrails API
Parameters
-
conversation: A list of dictionaries representing the conversation in OpenAI format. Each dictionary should have the keys
role
andcontent
. -
response: The model’s response in OpenAI format. This is the text that will be judged for safety.
-
judge_id: The unique identifier for the judge. Learn more about obtaining a judge ID.
-
space_id: The unique identifier for your space. Learn more about obtaining a space ID.
Response
The API returns a JSON object with the following fields:
-
judgement: Indicates the safety judgement of the model’s output. Possible values are:
1
: Safe/Compliant0
: Unsafe/Refusal
-
extra: Contains the raw output from the judge for further inspection.
-
category (Optional): Depending on the judge, this field may contain the category that was flagged for the response.
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.