Toxicity

POST
Check the toxicity of a given text.

Request

This endpoint expects an object.
text
stringRequired
The text to check for toxicity.

Response

This endpoint returns an object
id
stringOptional
Unique ID for the chat completion.
object
stringOptional
Type of object (chat completion).
created
integerOptional
Timestamp of when the chat completion was created.
checks
list of objectsOptional
The set of vectorized data.

Errors

POST
1curl -X POST https://api.predictionguard.com/toxicity \
2 -H "x-api-key: <apiKey>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "text": "Every flight I have is late and I am very angry. I want to hurt someone."
6}'
1{
2 "id": "toxi-bcUAQEaWhMweS3Jpi3nT9SJys28XN",
3 "object": "toxicity_check",
4 "created": 1717676257,
5 "checks": [
6 {
7 "index": 0,
8 "score": 0.7072361707687378,
9 "status": "success"
10 }
11 ]
12}