v1

latestOpenAPI 3.1.02026-07-267724480.0 KB

Create a moderation

Checks text or multimodal input with a moderation model. The response is OpenAI-compatible and returns one results item for each moderated input.

post/v1/moderations

Request body

modelstring required

Required moderation model ID. Use omni-moderation-latest for text and image moderation unless you have a specific moderation model requirement.

Example request

{
  "model": "omni-moderation-latest",
  "input": "...text to classify goes here..."
}

Response

Moderation decisions and token usage.

idstring required

Moderation request ID.

modelstring required

Model used for moderation.

Example response

{
  "id": "modr-1594",
  "model": "omni-moderation-latest",
  "results": [
    {
      "category_scores": {
        "harassment": 0.0001,
        "harassment/threatening": 0.0001,
        "hate": 0.0001,
        "hate/threatening": 0.0001,
        "illicit": 0.0001,
        "illicit/violent": 0.0001,
        "self-harm": 0.0001,
        "self-harm/intent": 0.0001,
        "self-harm/instructions": 0.0001,
        "sexual": 0.0001,
        "sexual/minors": 0.0001,
        "violence": 0.0001,
        "violence/graphic": 0.0001
      },
      "category_applied_input_types": {
        "harassment": [
          "text"
        ],
        "harassment/threatening": [
          "text"
        ],
        "hate": [
          "text"
        ],
        "hate/threatening": [
          "text"
        ],
        "illicit": [
          "text"
        ],
        "illicit/violent": [
          "text"
        ],
        "self-harm": [
          "text"
        ],
        "self-harm/intent": [
          "text"
        ],
        "self-harm/instructions": [
          "text"
        ],
        "sexual": [
          "text"
        ],
        "sexual/minors": [
          "text"
        ],
        "violence": [
          "text"
        ],
        "violence/graphic": [
          "text"
        ]
      }
    }
  ],
  "usage": {
    "prompt_tokens": 12,
    "total_tokens": 12,
    "input_tokens": 12
  }
}