> ## Documentation Index
> Fetch the complete documentation index at: https://docs.openp.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Moderations

> POST /v1/moderations — OpenAI content-safety classification

Score text (or images) across several content categories, returning a flag and score for each category.

## Request

```bash theme={null}
curl https://openp.ai/v1/moderations \
  -H "Authorization: Bearer $OPENPAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "omni-moderation-latest",
    "input": "I want to hurt myself."
  }'
```

### Parameters

| Field   | Type            | Required | Description                                                               |
| ------- | --------------- | :------: | ------------------------------------------------------------------------- |
| `model` | string          |          | `omni-moderation-latest` (recommended) or `text-moderation-latest`        |
| `input` | string \| array |     ✅    | The text to check, or a multimodal array (the omni model supports images) |

## Response

```json theme={null}
{
  "id": "modr-...",
  "model": "omni-moderation-latest",
  "results": [
    {
      "flagged": true,
      "categories": {
        "self-harm": true,
        "self-harm/intent": true,
        "violence": false,
        "sexual": false
      },
      "category_scores": {
        "self-harm": 0.94,
        "self-harm/intent": 0.91,
        "violence": 0.01
      }
    }
  ]
}
```

`flagged: true` means any category was triggered.

## Multimodal (image) input

```json theme={null}
{
  "model": "omni-moderation-latest",
  "input": [
    {"type": "text", "text": "Look at this image"},
    {"type": "image_url", "image_url": {"url": "https://..."}}
  ]
}
```

## Categories

| Category                 | Meaning                |
| ------------------------ | ---------------------- |
| `sexual`                 | Sexual content         |
| `sexual/minors`          | Involving minors       |
| `harassment`             | Harassment             |
| `harassment/threatening` | Threatening harassment |
| `hate`                   | Hate                   |
| `hate/threatening`       | Threatening hate       |
| `illicit`                | Illicit behavior       |
| `illicit/violent`        | Violent illicit        |
| `self-harm`              | Self-harm              |
| `self-harm/intent`       | Self-harm intent       |
| `self-harm/instructions` | Self-harm instructions |
| `violence`               | Violence               |
| `violence/graphic`       | Graphic violence       |

## Billing

The OpenAI Moderation endpoint is provided **free** by OpenAI, and OpenPAI usually doesn't charge for it (subject to the console display).
