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
$curl -X POST https://api.predictionguard.com/toxicity \
> -H "x-api-key: <apiKey>" \
> -H "Content-Type: application/json" \
> -d '{
> "text": "text"
>}'
Response
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}