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

# omni-moderation-latest Content Moderation

>  - Supports text, image, and mixed text+image content moderation
- Compatible with single text, text array, and content block array inputs
- Images support public URLs and base64 Data URIs 

Use `omni-moderation-latest` to perform safety moderation on input content. This model belongs to the Moderation Series and is not part of the image, video, or audio generation series.

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://gccai.heqingsong.uk/v1/moderations \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --data '{
      "model": "omni-moderation-latest",
      "input": [
        {
          "type": "text",
          "text": "Please moderate whether this image is compliant"
        },
        {
          "type": "image_url",
          "image_url": {
            "url": "https://gccai.heqingsong.uk/_gccai/cdn/files/1779955589195-wh950j4imqd.jpeg"
          }
        }
      ],
      "stream": false
    }'
  ```

  ```python Python theme={null}
  import requests

  url = "https://gccai.heqingsong.uk/v1/moderations"

  payload = {
      "model": "omni-moderation-latest",
      "input": [
          {
              "type": "text",
              "text": "Please moderate whether this image is compliant"
          },
          {
              "type": "image_url",
              "image_url": {
                  "url": "https://gccai.heqingsong.uk/_gccai/cdn/files/1779955589195-wh950j4imqd.jpeg"
              }
          }
      ],
      "stream": False
  }

  headers = {
      "Authorization": "Bearer <token>",
      "Content-Type": "application/json"
  }

  response = requests.post(url, json=payload, headers=headers)

  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const url = "https://gccai.heqingsong.uk/v1/moderations";

  const payload = {
    model: "omni-moderation-latest",
    input: [
      {
        type: "text",
        text: "Please moderate whether this image is compliant",
      },
      {
        type: "image_url",
        image_url: {
          url: "https://gccai.heqingsong.uk/_gccai/cdn/files/1779955589195-wh950j4imqd.jpeg",
        },
      },
    ],
    stream: false,
  };

  const headers = {
    Authorization: "Bearer <token>",
    "Content-Type": "application/json",
  };

  fetch(url, {
    method: "POST",
    headers: headers,
    body: JSON.stringify(payload),
  })
    .then((response) => response.json())
    .then((data) => console.log(data))
    .catch((error) => console.error("Error:", error));
  ```
</RequestExample>

## Supported Models

| Model                    | Description                              | Supported Inputs              |
| ------------------------ | ---------------------------------------- | ----------------------------- |
| `omni-moderation-latest` | General-purpose content moderation model | Text, image, mixed text+image |

## Authorizations

<ParamField header="Authorization" type="string" required>
  All endpoints require authentication using a Bearer Token.

  Get an API Key:

  Visit the [API Key management page](https://gccai.heqingsong.uk/keys) to obtain your API Key.

  Add the following header in your request:

  ```
  Authorization: Bearer YOUR_API_KEY
  ```
</ParamField>

## Body

<ParamField body="model" type="string" required>
  Moderation model name.

  * `omni-moderation-latest` - General-purpose content moderation model
</ParamField>

<ParamField body="input" type="string | string[] | object[]" required>
  Content to be moderated. Supports plain text, text array, or content block array.

  Content blocks can include:

  * `text` - Text content block
  * `image_url` - Image URL content block
</ParamField>

<ParamField body="stream" type="boolean" default="false">
  Whether to stream the response.

  * `false`: Non-streaming response (default; the only value currently supported, `true` is not supported)
</ParamField>

## input Request Modes

### Mixed Text + Image

```json theme={null}
{
  "model": "omni-moderation-latest",
  "input": [
    {
      "type": "text",
      "text": "Please moderate whether this image is compliant"
    },
    {
      "type": "image_url",
      "image_url": {
        "url": "https://gccai.heqingsong.uk/_gccai/cdn/files/1779955589195-wh950j4imqd.jpeg"
      }
    }
  ],
  "stream": false
}
```

### Plain Text (Single)

```json theme={null}
{
  "model": "omni-moderation-latest",
  "input": "I want to kill someone",
  "stream": false
}
```

### Plain Text (Array)

```json theme={null}
{
  "model": "omni-moderation-latest",
  "input": [
    "hello",
    "I hate you"
  ],
  "stream": false
}
```

### Image Only (Image URL)

```json theme={null}
{
  "model": "omni-moderation-latest",
  "input": [
    {
      "type": "image_url",
      "image_url": {
        "url": "https://gccai.heqingsong.uk/_gccai/cdn/files/1779955589195-wh950j4imqd.jpeg"
      }
    }
  ],
  "stream": false
}
```

### Image Only (base64 Data URI)

```json theme={null}
{
  "model": "omni-moderation-latest",
  "input": [
    {
      "type": "image_url",
      "image_url": {
        "url": "data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAA..."
      }
    }
  ],
  "stream": false
}
```

## Notes

1. When `input` is a content block array, each element uses `type` to distinguish content type.
2. For image moderation, prefer using publicly accessible URLs. If using base64, follow the standard Data URI format: `data:image/{format};base64,{data}`.
3. Unless required otherwise, set `stream: false` consistently.
