> ## 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.

# Image Content Moderation API — POST /v1/moderations

> POST /v1/moderations with model gi-image-moderation checks images for NSFW content across 5 categories including neutral, sexy, and explicit.

The `/v1/moderations` endpoint also accepts images for NSFW and content policy classification. Pass an image URL or a base64-encoded data URI in your request to receive per-category confidence scores and a top-level `flagged` boolean — giving you everything you need to gate image uploads or flag content for review.

## 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>
  Must be `gi-image-moderation` for image classification.
</ParamField>

<ParamField body="input" type="array" required>
  An array of image objects to moderate. Each object describes one image.

  <Expandable title="input[] fields">
    <ParamField body="input[].type" type="string" required>
      Must be `"image_url"`.
    </ParamField>

    <ParamField body="input[].image_url.url" type="string" required>
      The URL of the image to moderate, or a base64-encoded data URI (e.g. `data:image/png;base64,...`).
    </ParamField>
  </Expandable>
</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": "gi-image-moderation",
        "input": [
          {
            "type": "image_url",
            "image_url": {
              "url": "https://example.com/image.png"
            }
          }
        ]
      }'
    ```
  </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="gi-image-moderation",
        input=[{
            "type": "image_url",
            "image_url": {"url": "https://example.com/image.png"}
        }]
    )

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

## Response Categories

The image moderation model scores each image across five categories:

| Category   | Description                                                                        |
| ---------- | ---------------------------------------------------------------------------------- |
| `neutral`  | No sexual content detected                                                         |
| `drawings` | Normal image with slight sexual possibility (e.g. illustrated or animated content) |
| `sexy`     | Provocative or suggestive content                                                  |
| `hentai`   | Adult anime or illustrated sexual content                                          |
| `porn`     | Explicit sexual content                                                            |

<Info>
  Scores across categories are independent confidence values — they do not sum to 1. Evaluate each category score against your own threshold to suit your application's moderation policy.
</Info>

## Response

```json theme={null}
{
  "id": "abfc99e9-392e-44e3-aedd-e63f33079491",
  "model": "gi-image-moderation",
  "results": [
    {
      "flagged": false,
      "categories": {
        "neutral": false,
        "drawings": true,
        "sexy": false,
        "hentai": false,
        "porn": false
      },
      "category_scores": {
        "neutral": 0.2273,
        "drawings": 0.9944,
        "sexy": 0.1233,
        "hentai": 0.2199,
        "porn": 0.0557
      }
    }
  ]
}
```

### Response Fields

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

<ResponseField name="model" type="string">
  The classifier model that processed the image.
</ResponseField>

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

  <Expandable title="results[] fields">
    <ResponseField name="results[].flagged" type="boolean">
      `true` if the image triggered one or more content categories; `false` otherwise.
    </ResponseField>

    <ResponseField name="results[].categories" type="object">
      A map of each of the five category names (`neutral`, `drawings`, `sexy`, `hentai`, `porn`) to a boolean indicating whether that category was triggered.
    </ResponseField>

    <ResponseField name="results[].category_scores" type="object">
      A map of each category name to a floating-point confidence score. Use these scores to implement custom severity thresholds tailored to your platform's content policy.
    </ResponseField>
  </Expandable>
</ResponseField>
