Using the Detoxic API is easy for developers to use. The API uses JSON for requests and responses.
Classifies a message on several different types of toxicity. The message must be sent along side the API key in JSON:
{
"apikey": "YOUR-API-KEY",
"text": "YOUR-TEXT",
"convertNumbers": boolean
}
The boolean convertNumbers is optional, and will convert numbers to words. For example, "1" will be converted to "i".
It will return a JSON object with the toxicity scores:
{
"toxicity": 0.0,
"severe_toxicity": 0.0,
"obscene": 0.0,
"threat": 0.0,
"insult": 0.0,
"identity_attack": 0.0
}
Higher scores means higher confidence that the message is toxic in some way. The maximum score per category is 1.
Get stats for your API key. The API key must be sent along side the request in JSON:
{
"apikey": "YOUR-API-KEY"
}
The response will look like this:
{
"requests": 0
}
As Detoxic is currently in Alpha, the use of the API is free. While we are in Alpha, we will be monitoring the usage of the API and may charge for it in the future. To get an API key, talk about your use case, or ask any questions, contact us at [email protected] or join our Discord.
We do not collect any personal information from users of the API. We do collect the text sent to the API, these are used to log the usage of the API and are not stored for longer than 30 days.
As the Detoxic is based on an AI, the response time can vary. The average response time is 0.25 seconds, but these results can vary depending on length of the message and the load on the server. Detoxic is currently running on a single server, and we are working on scaling the API to handle more requests. In case of any speed issues, please contact us at [email protected] or join our Discord.
The Detoxic API is based on an AI. While we have done our best to make it as accurate as possible, it is not perfect. The API does not understand context, and may classify messages as toxic when they are not or vice versa.
Also notice, that some basic words are not automatically blocked by the AI. Use a blacklist for community specific words that should be blocked.