Skip to content

Moderations

Classify if text or images are potentially inappropriate (e.g., hate speech, violence, NSFW content).

Endpoint

POST /proxy/v1/moderations

Request Body

ParameterTypeRequiredDescription
inputstringYesText to classify

Example Request

bash
curl https://ai.hackclub.com/proxy/v1/moderations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "I want to kill them."
  }'

Example Response

json
{
  "id": "modr-5558",
  "model": "omni-moderation-latest",
  "results": [
    {
      "flagged": true,
      "categories": {
        "harassment": false,
        "harassment/threatening": false,
        "sexual": false,
        "hate": false,
        "hate/threatening": false,
        "illicit": false,
        "illicit/violent": false,
        "self-harm/intent": false,
        "self-harm/instructions": false,
        "self-harm": false,
        "sexual/minors": false,
        "violence": true,
        "violence/graphic": false
      },
      "category_scores": {
        "harassment": 0.009,
        "harassment/threatening": 0.001,
        "sexual": 0.0002,
        "hate": 0.001,
        "hate/threatening": 0.00002,
        "illicit": 0.004,
        "illicit/violent": 0.00003,
        "self-harm/intent": 0.0002,
        "self-harm/instructions": 0.000003,
        "self-harm": 0.00001,
        "sexual/minors": 0.0002,
        "violence": 0.93,
        "violence/graphic": 0.000004
      },
      "category_applied_input_types": {
        "harassment": ["text"],
        "harassment/threatening": ["text"],
        "sexual": ["text"],
        "hate": ["text"],
        "hate/threatening": ["text"],
        "illicit": ["text"],
        "illicit/violent": ["text"],
        "self-harm/intent": ["text"],
        "self-harm/instructions": ["text"],
        "self-harm": ["text"],
        "sexual/minors": ["text"],
        "violence": ["text"],
        "violence/graphic": ["text"]
      }
    }
  ]
}

Categories

CategoryDescription
harassmentHarassing language
harassment/threateningThreatening harassment
sexualSexual content
hateHate speech
hate/threateningThreatening hate speech
illicitIllegal activity
illicit/violentViolent illegal activity
self-harmSelf-harm content
self-harm/intentIntent to self-harm
self-harm/instructionsInstructions for self-harm
sexual/minorsSexual content involving minors
violenceViolent content
violence/graphicGraphic violence