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

# omni-moderation-latest 콘텐츠 모더레이션

>  - 텍스트, 이미지, 텍스트+이미지 혼합 콘텐츠 모더레이션 지원
- 단일 텍스트, 텍스트 배열, 콘텐츠 블록 배열 입력 호환
- 이미지는 공개 URL 및 base64 Data URI 지원 

`omni-moderation-latest`를 사용하여 입력 콘텐츠에 대한 안전 모더레이션을 수행합니다. 이 모델은 모더레이션 시리즈에 속하며, 이미지/비디오/오디오 생성 시리즈에는 포함되지 않습니다.

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://api.apimart.ai/v1/moderations \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --data '{
      "model": "omni-moderation-latest",
      "input": [
        {
          "type": "text",
          "text": "이 이미지가 위반되는지 모더레이션해 주세요"
        },
        {
          "type": "image_url",
          "image_url": {
            "url": "https://cdn.apimart.ai/files/1779955589195-wh950j4imqd.jpeg"
          }
        }
      ],
      "stream": false
    }'
  ```

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

  url = "https://api.apimart.ai/v1/moderations"

  payload = {
      "model": "omni-moderation-latest",
      "input": [
          {
              "type": "text",
              "text": "이 이미지가 위반되는지 모더레이션해 주세요"
          },
          {
              "type": "image_url",
              "image_url": {
                  "url": "https://cdn.apimart.ai/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://api.apimart.ai/v1/moderations";

  const payload = {
    model: "omni-moderation-latest",
    input: [
      {
        type: "text",
        text: "이 이미지가 위반되는지 모더레이션해 주세요",
      },
      {
        type: "image_url",
        image_url: {
          url: "https://cdn.apimart.ai/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>

## 지원 모델

| 모델명                      | 설명              | 지원 입력                |
| ------------------------ | --------------- | -------------------- |
| `omni-moderation-latest` | 범용 콘텐츠 모더레이션 모델 | 텍스트, 이미지, 텍스트+이미지 혼합 |

## Authorizations

<ParamField header="Authorization" type="string" required>
  모든 엔드포인트는 Bearer Token 인증이 필요합니다.

  API Key 발급:

  [API Key 관리 페이지](https://apimart.ai/keys)에 접속하여 API Key를 발급받으세요.

  요청 헤더에 다음을 추가합니다:

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

## Body

<ParamField body="model" type="string" required>
  모더레이션 모델명입니다.

  * `omni-moderation-latest` - 범용 콘텐츠 모더레이션 모델
</ParamField>

<ParamField body="input" type="string | string[] | object[]" required>
  모더레이션할 콘텐츠입니다. 일반 텍스트, 텍스트 배열, 콘텐츠 블록 배열을 지원합니다.

  콘텐츠 블록에는 다음을 포함할 수 있습니다:

  * `text` - 텍스트 콘텐츠 블록
  * `image_url` - 이미지 URL 콘텐츠 블록
</ParamField>

<ParamField body="stream" type="boolean" default="false">
  스트리밍 응답 여부입니다.

  * `false`: 비스트리밍 응답 (기본값. 현재 이 값만 지원하며 `true`는 지원하지 않음)
</ParamField>

## input 요청 방식

### 텍스트+이미지 혼합

```json theme={null}
{
  "model": "omni-moderation-latest",
  "input": [
    {
      "type": "text",
      "text": "이 이미지가 위반되는지 모더레이션해 주세요"
    },
    {
      "type": "image_url",
      "image_url": {
        "url": "https://cdn.apimart.ai/files/1779955589195-wh950j4imqd.jpeg"
      }
    }
  ],
  "stream": false
}
```

### 일반 텍스트(단일)

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

### 일반 텍스트(배열)

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

### 이미지 전용(이미지 URL)

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

### 이미지 전용(base64 Data URI)

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

## 참고 사항

1. `input`이 콘텐츠 블록 배열인 경우 각 요소는 `type`으로 콘텐츠 종류를 구분합니다.
2. 이미지 모더레이션은 공개적으로 접근 가능한 URL 사용을 권장합니다. base64를 사용할 경우 표준 Data URI 형식 `data:image/{format};base64,{data}`를 따르세요.
3. 특별한 요구가 없다면 `stream: false`를 일관되게 사용하는 것을 권장합니다.
