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

# Text Content Moderation API — POST /v1/moderations

> POST /v1/moderations checks text for policy violations across 13 categories including violence, harassment, hate speech, and self-harm.

Use the `/v1/moderations` endpoint to check text content for policy violations. The response includes a per-category boolean flag indicating whether each policy category was triggered, along with confidence scores for each category — giving you fine-grained control over how you apply moderation thresholds in your application.

## Request

**POST** `https://kiosapi.com/v1/moderations`

### Headers

<ParamField header="Content-Type" type="string" required>
  Must be `application/json`.
</ParamField>

<ParamField header="Authorization" type="string" required>
  Your API key in the format `Bearer sk-xxx`.
</ParamField>

### Request Body

<ParamField body="model" type="string" required>
  The moderation model to use. Example: `text-moderation-latest`.
</ParamField>

<ParamField body="input" type="string" required>
  The text content you want to check for policy violations.
</ParamField>

### Example Request

<Tabs>
  <Tab title="cURL">
    ```bash theme={null}
    curl https://kiosapi.com/v1/moderations \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer sk-xxx" \
      -d '{
        "model": "text-moderation-latest",
        "input": "She is very beautiful, I like..."
      }'
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    import openai

    openai.api_key = "sk-xxx"
    openai.base_url = "https://kiosapi.com/v1/"

    response = openai.moderations.create(
        model="text-moderation-latest",
        input="She is very beautiful, I like..."
    )

    print(response.results[0].flagged)
    ```
  </Tab>
</Tabs>

## Categories

The moderation model evaluates your input across the following 13 categories:

| Category                 | Description                                   |
| ------------------------ | --------------------------------------------- |
| `sexual`                 | Sexually explicit content                     |
| `sexual/minors`          | Sexual content involving minors               |
| `harassment`             | Harassing or bullying language                |
| `harassment/threatening` | Harassment that includes threats              |
| `hate`                   | Hate speech targeting protected groups        |
| `hate/threatening`       | Hate speech that includes threats of violence |
| `illicit`                | Content promoting illegal activities          |
| `illicit/violent`        | Illegal activities involving violence         |
| `self-harm`              | Content depicting or promoting self-harm      |
| `self-harm/intent`       | Expressed intent to engage in self-harm       |
| `self-harm/instructions` | Instructions for self-harm                    |
| `violence`               | Violent content or descriptions               |
| `violence/graphic`       | Graphic or gratuitous violent content         |

<Note>
  The top-level `flagged` field is `true` if **any** of the 13 categories is triggered, providing a convenient single signal for content filtering. Use the individual `categories` and `category_scores` fields for more granular control.
</Note>

## Response

```json theme={null}
{
  "id": "modr-970d409ef3bef3b70c73d8232df86e7d",
  "model": "text-moderation-latest",
  "results": [
    {
      "flagged": true,
      "categories": {
        "sexual": false,
        "sexual/minors": false,
        "harassment": false,
        "harassment/threatening": false,
        "hate": false,
        "hate/threatening": false,
        "illicit": false,
        "illicit/violent": false,
        "self-harm": false,
        "self-harm/intent": false,
        "self-harm/instructions": false,
        "violence": true,
        "violence/graphic": false
      },
      "category_scores": {
        "sexual": 0.0000002341,
        "violence": 0.8599265510,
        "violence/graphic": 0.3770173639
      }
    }
  ]
}
```

### Response Fields

<ResponseField name="id" type="string">
  A unique identifier for this moderation request.
</ResponseField>

<ResponseField name="model" type="string">
  The moderation model that processed the request.
</ResponseField>

<ResponseField name="results" type="array">
  An array of moderation result objects, one per input.

  <Expandable title="results[] fields">
    <ResponseField name="results[].flagged" type="boolean">
      `true` if the input triggered one or more policy categories; `false` otherwise. Use this as your primary pass/fail signal.
    </ResponseField>

    <ResponseField name="results[].categories" type="object">
      A map of each of the 13 category names to a boolean. `true` means that category was triggered for the input.
    </ResponseField>

    <ResponseField name="results[].category_scores" type="object">
      A map of category names to floating-point confidence scores. Higher values indicate higher model confidence that the category applies. You can use these scores to implement custom severity thresholds beyond the default boolean flags.
    </ResponseField>
  </Expandable>
</ResponseField>
