POST
/
toxicity-meter
curl --request POST \
  --url https://rai-prod.studio.lyzr.ai/toxicity-meter/ \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "input_text": "What the fuck!",
  "agent_id": "67e3aff94c4db47d2999cdef",
  "session_id": "67e3aff94c4db47d2999cdef-g6bayx8ijn",
  "run_id": "string"
}'
{
  "message": "TOXIC",
  "details": {
    "is_toxic": true,
    "confidence": 99.9
  },
  "status_code": 200
}

Endpoint

POST /toxicity-meter/

Base URL

https://rai-prod.studio.lyzr.ai

Authentication

API Key (x-api-key) must be included in the request header.

Request Body

FieldTypeRequiredDescription
input_textstringYesThe text to analyze for toxicity.
agent_idstringYesThe associated agent’s unique ID.
session_idstringYesThe current session’s unique ID.
run_idstringNoOptional run ID for traceability.

Example Request Body

{
  "input_text": "What the hell!"
  "agent_id": "67e3aff94c4db47d2999cdef",
  "session_id": "67e3aff94c4db47d2999cdef-g6bayx8ijn",
  "run_id": "string"
}

Authorizations

x-api-key
string
header
required

Body

application/json

Response

200
application/json

Successful toxicity check

The response is of type object.