Serverless AI Text Moderation

AI powered text moderation service that analyzes text for potentially harmful or inappropriate content.

Endpoint

Text moderation with confidence scores for various labels

POSThttps://api.xtartapp.com/text/moderation

*Authentication

You must use a Bearer token provided by the dashboard to use for authentication. Add the token to the Authorization header.

Request body

NameTypeRequiredMaxDescription
textstringYes2500The text to moderate

Response

NameTypeDescription
dataobjectThe data of the text moderation
data.classificationsarrayArray of classifications with labels and confidence scores
data.classifications[].labelstringThe moderation label, labels list: 'sexual', 'harassment', 'hate', 'illicit', 'harm', 'violence', 'racism', 'insult', 'spam', 'terrorism', 'self-harm', 'drugs', 'gambling', 'pornography', 'personal', 'political', 'religious'
data.classifications[].confidencenumberThe confidence score for the label

Errors

{
   "error": "string", 
   "code": "string"
}
HTTP StatusError CodeMessage
400INVALID_PAYLOADOccurs when the payload is invalid.
400INVALID_REQUESTEx.: The request is invalid.
400TEXT_MODERATION_ERROREx: could not moderate the text | parsing error
400HARM_CONTENTEx.: The content is harmful and cannot be processed.
400INSUFFICIENT_BALANCEThe user has insufficient balance
401UNAUTHORIZEDEx.: The token is invalid.
429TOO_MANY_REQUESTSEx.: The request limit has been reached.