Check Toxicity

POST
Check the toxicity of a given text.

Request

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

Response

This endpoint returns an object
checks
list of objectsOptional
created
integerOptional
Timestamp of when the toxicity check was created.
id
stringOptional
Unique ID for the toxicity check.
object
stringOptional
Type of object (toxicity check).
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": "text"
6}'
200
Successful
1{
2 "checks": [
3 {
4 "score": 0.00036882987478747964,
5 "index": 0,
6 "status": "success"
7 }
8 ],
9 "created": 1701721860,
10 "id": "toxi-REU4ZqFADGAiU6xJmN9PgtlgBO6x9",
11 "object": "toxicity_check"
12}