About this endpoint
What it does
Detects whether the submitted text is toxic or harmful and returns a JSON object with the analyzed text, a label, a score, and a toxic boolean.
Request Body
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| text | String | Yes | Input text to analyze. Maximum length: 512 characters. The schema description says it is truncated to 512 tokens. |
Response
Returns a JSON object with four top-level fields: text as a string, label as a string, score as a number, and toxic as a boolean. Use toxic to determine whether the input was classified as toxic or harmful.
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| text | String | No | The text that was analyzed. |
| label | String | No | The classification label returned by the service. |
| score | Number | No | The confidence or score returned by the service. |
| toxic | Boolean | No | Whether the text is classified as toxic or harmful. |