Everstack

Classify content for policy violations

POST/v1/moderations
POST/v1/moderations

Your instance endpoint, shown on the instance page in the dashboard. Each instance has its own host; there is no shared API host.

Request Body

PropertyTypeRequiredDescription
inputstringNo
inputsobject[]No
modelstringNo
metadataobjectNo

Responses

200 Moderation results

PropertyTypeDescription
idstring
modelstring
resultsobject[]

default An unexpected error response.

PropertyTypeDescription
codeinteger
messagestring
detailsobject[]

Request

curl -X POST "http://localhost:8089/v1/moderations" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input":"string","inputs":[{"type":"string","text":"string","imageUrl":{"url":"string"}}],"model":"string"}'
const response = await fetch("http://localhost:8089/v1/moderations", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
  "input": "string",
  "inputs": [
    {
      "type": "string",
      "text": "string",
      "imageUrl": {
        "url": "string"
      }
    }
  ],
  "model": "string"
}),
});
const data = await response.json();
import requests

response = requests.post(
    "http://localhost:8089/v1/moderations",
    headers={
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json",
    },
    json={
  "input": "string",
  "inputs": [
    {
      "type": "string",
      "text": "string",
      "imageUrl": {
        "url": "string"
      }
    }
  ],
  "model": "string"
},
)
data = response.json()

Response

{
  "id": "string",
  "model": "string",
  "results": [
    {
      "flagged": true,
      "categories": {
        "hate": true,
        "hateThreatening": true,
        "harassment": true,
        "harassmentThreatening": true,
        "illicit": true,
        "illicitViolent": true,
        "selfHarm": true,
        "selfHarmIntent": true,
        "selfHarmInstructions": true,
        "sexual": true,
        "sexualMinors": true,
        "violence": true,
        "violenceGraphic": true
      },
      "categoryScores": {
        "hate": 0,
        "hateThreatening": 0,
        "harassment": 0,
        "harassmentThreatening": 0,
        "illicit": 0,
        "illicitViolent": 0,
        "selfHarm": 0,
        "selfHarmIntent": 0,
        "selfHarmInstructions": 0,
        "sexual": 0,
        "sexualMinors": 0,
        "violence": 0,
        "violenceGraphic": 0
      },
      "categoryAppliedInputTypes": {
        "hate": [],
        "hateThreatening": [],
        "harassment": [],
        "harassmentThreatening": [],
        "illicit": [],
        "illicitViolent": [],
        "selfHarm": [],
        "selfHarmIntent": [],
        "selfHarmInstructions": [],
        "sexual": [],
        "sexualMinors": [],
        "violence": [],
        "violenceGraphic": []
      }
    }
  ]
}
{
  "code": 0,
  "message": "string",
  "details": [
    {
      "@type": "string"
    }
  ]
}