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

# Omni Moderation 内容审核

> Omni Moderation API 按 OpenAI 安全类别审核文本和一张 HTTPS 图片，返回每个类别的命中结果、得分和适用的输入类型。

> [!TIP]
>
> 1. 提交后会返回 `task_id`。如果提供了 `callback_url`，当任务状态变为 `finished` 或 `failed` 时，系统会向 `callback_url` 发送 POST 请求。
> 2. 无论是否提供 `callback_url`，都可以通过统一的[查询任务状态](https://docs.vidgo.ai/zh/api-manual/task-management/status.md)接口获取结果。

Omni Moderation 使用 OpenAI 的多模态审核模型 `omni-moderation-latest` 审核文本、图片或两者，返回输入是否被标记以及各类别得分。可在把用户提示词和上传内容发送给生成模型之前先做筛查。

该接口与生成模型使用相同的任务流程：提交到 `/api/generate/submit`，然后从[查询任务状态](https://docs.vidgo.ai/zh/api-manual/task-management/status.md)接口或回调内容的 `output` 字段读取审核结果。

## 模型

* **openai/omni-moderation-latest** — 使用 OpenAI Omni Moderation 模型审核文本和图片。

## 功能

* 单次请求审核文本、一张图片或两者。
* 13 个类别，每个类别都有布尔标记和 0 到 1 之间的得分。
* `category_applied_input_types` 显示每个类别审核了文本、图片还是两者。
* 与所有 Vidgo 任务一样支持 `callback_url`。

## 输入模式

* **文本**：提供 `prompt`。
* **图片**：在 `image_urls` 中提供一个 HTTPS URL。
* **文本加图片**：两者都提供；支持图片的类别会同时审核两种输入。

## 必填参数

* `prompt` 和 `image_urls` 至少提供一项。

## 可选参数

* `prompt` (string)：要审核的文本。
* `image_urls` (string\[])：最多一个公开的 HTTPS 图片 URL。

## 输出

任务完成后，`files` 数组为空，完整的审核结果在 `output` 中：

```json theme={"dark"}
{
  "id": "modr-4603",
  "model": "omni-moderation-latest",
  "results": [
    {
      "categories": {
        "harassment": false,
        "harassment/threatening": false,
        "hate": false,
        "hate/threatening": false,
        "illicit": false,
        "illicit/violent": false,
        "self-harm": false,
        "self-harm/instructions": false,
        "self-harm/intent": false,
        "sexual": false,
        "sexual/minors": false,
        "violence": false,
        "violence/graphic": false
      },
      "category_applied_input_types": {
        "harassment": [
          "text"
        ],
        "harassment/threatening": [
          "text"
        ],
        "hate": [
          "text"
        ],
        "hate/threatening": [
          "text"
        ],
        "illicit": [
          "text"
        ],
        "illicit/violent": [
          "text"
        ],
        "self-harm": [
          "text"
        ],
        "self-harm/instructions": [
          "text"
        ],
        "self-harm/intent": [
          "text"
        ],
        "sexual": [
          "text"
        ],
        "sexual/minors": [
          "text"
        ],
        "violence": [
          "text"
        ],
        "violence/graphic": [
          "text"
        ]
      },
      "category_scores": {
        "harassment": 1.5206840370677115e-06,
        "harassment/threatening": 1.816222403812674e-07,
        "hate": 1.0953122821495382e-06,
        "hate/threatening": 8.851569304133282e-08,
        "illicit": 8.530321297909616e-07,
        "illicit/violent": 5.77192003016332e-07,
        "self-harm": 4.53978687024344e-06,
        "self-harm/instructions": 1.628051547091001e-07,
        "self-harm/intent": 1.7231572752142392e-06,
        "sexual": 3.3931448129766124e-07,
        "sexual/minors": 8.059446204294678e-08,
        "violence": 9.028039015031105e-06,
        "violence/graphic": 3.535625074174432e-06
      },
      "flagged": false
    }
  ]
}
```

* `results[0].flagged` (boolean)：输入在任一类别被标记时为 `true`。
* `results[0].categories` (object)：每个类别一个布尔值。
* `results[0].category_scores` (object)：每个类别一个 0 到 1 的得分，越高表示可能性越大。
* `results[0].category_applied_input_types` (object)：每个类别审核的输入类型（`text`、`image`）。

类别：`harassment`、`harassment/threatening`、`hate`、`hate/threatening`、`illicit`、`illicit/violent`、`self-harm`、`self-harm/instructions`、`self-harm/intent`、`sexual`、`sexual/minors`、`violence`、`violence/graphic`。

## 示例

* **文本加图片**：一段场景描述加对应的火车站候车室图片；`flagged: false`。
* **仅文本**：一段关于灯塔看守人和海鹦的小故事；`flagged: false`。

## 注意事项

* `image_urls` 接收一个 HTTPS URL；data URI、Base64 字符串和其他协议返回 400。
* `input` 接收 `prompt` 和 `image_urls`，其他字段返回 400。`model` 和 `callback_url` 放在请求根级。
* 当前费率见[定价页](https://vidgo.ai/apis/api-pricing)。


## OpenAPI

````yaml zh/api-manual/tools-series/openai-omni-moderation-latest.json POST /api/generate/submit
openapi: 3.0.0
info:
  title: Vidgo API - Omni Moderation 内容审核
  description: Omni Moderation API 按 OpenAI 安全类别审核文本和一张 HTTPS 图片，返回每个类别的命中结果、得分和适用的输入类型。
  version: 1.0.0
servers:
  - url: https://api.vidgo.ai
    description: 生产环境服务器
security:
  - BearerAuth: []
paths:
  /api/generate/submit:
    post:
      tags:
        - Omni Moderation
      summary: 提交 Omni Moderation 内容审核 任务
      operationId: submitOmniModerationTask
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitRequest'
            examples:
              text-and-image:
                summary: 文本加图片
                value:
                  model: openai/omni-moderation-latest
                  input:
                    prompt: >-
                      An elderly grandfather and his granddaughter sit in a
                      quiet rural railway waiting room on a rainy autumn night
                      while a station attendant offers tea.
                    image_urls:
                      - >-
                        https://cdn.vidgo.ai/apis/models/bytedance/seedream-v5.0-flash/text-to-image/v1/01/output.png
              text-only:
                summary: 仅文本
                value:
                  model: openai/omni-moderation-latest
                  input:
                    prompt: >-
                      At dusk on a windswept Icelandic cliff, an elderly
                      lighthouse keeper lights a brass lantern while a small
                      Atlantic puffin watches the rolling waves below.
      responses:
        '200':
          description: 任务提交结果。任务 ID 标识一项异步任务；生成可能仍在进行中。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubmitResponse'
        '400':
          description: 请求参数无效
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: 未授权
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    SubmitRequest:
      type: object
      required:
        - model
        - input
      additionalProperties: false
      properties:
        model:
          type: string
          example: openai/omni-moderation-latest
        callback_url:
          type: string
          format: uri
          description: 可选的 Webhook URL，用于接收完成或失败通知。
          example: https://your-domain.com/callback
        input:
          type: object
          additionalProperties: false
          properties:
            prompt:
              type: string
              description: 要审核的文本。`prompt` 和 `image_urls` 至少提供一项，也可同时提供。
            image_urls:
              type: array
              maxItems: 1
              items:
                type: string
                format: uri
                description: 使用公开可访问的 HTTPS 图片链接。
              description: 最多一张要审核的图片，使用公开的 HTTPS URL。
          description: '`prompt` 和 `image_urls` 至少提供一项。'
    SubmitResponse:
      type: object
      required:
        - code
        - data
      properties:
        code:
          type: integer
          example: 200
        data:
          type: object
          required:
            - task_id
            - status
            - created_time
          properties:
            task_id:
              type: string
              example: 3K8RB0DB7SGSLQJG
            status:
              type: string
              example: not_started
            created_time:
              type: string
              format: date-time
              example: '2026-11-25T11:13:01'
    ErrorResponse:
      type: object
      required:
        - detail
      properties:
        detail:
          type: string
          description: 错误信息。参见[错误码](/zh/api-manual/error-codes)。
          example: prompt or image_urls is required
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: '使用 `Authorization: Bearer VIDGO_API_KEY`。'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.