Moderations

Classify text or multimodal inputs with OpenAI moderation.

post/v1/moderations

Request body

modelstring

OpenAI moderation model. Defaults to omni-moderation-latest.

Example request

{
  "input": "I want to harm someone.",
  "model": "omni-moderation-latest"
}

Response

Moderation response.

idstring

Moderation response ID.

modelstring

Moderation model used for the request.

Example response

{
  "id": "modr-123",
  "model": "openai/openai-moderation",
  "results": [
    {
      "flagged": true,
      "categories": {
        "violence": true,
        "self_harm": false
      },
      "category_scores": {
        "violence": 0.98,
        "self_harm": 0.01
      }
    }
  ]
}

Changes

No recorded changes to this endpoint across all 1 revision of this API.