---
title: "内容安全"
method: POST
path: "/paas/v4/moderations"
tags: ["工具 API"]
---

# 内容安全

`POST /paas/v4/moderations`

可对文本、图片、音频、视频格式类型的内容进行检测，精准识别涉黄、涉暴、违法违规等风险内容，并输出结构化审核结果（包括内容类型、风险类型及具体风险内容片段），快速定位和处理违规信息。点击 **Try it** 按钮可快速试用。

## Request body

- ModerationRequest
  - `model` 'moderation', required — 安全模型
  - `input` union, required — 需要审核的内容 纯文本字符串（最大输入长度：`2000` 字符） 多媒体对象(`type+url`) 图片：图片小于 `10M`，最低分辨率 `20* 20`，不超过 `6000 * 6000` 视频：推荐视频时长 `30` 秒 音频：推荐音频时长 `60` 秒
    - string — 需要审核的文本内容
    - object — 单个多模态审核内容
      - `type` 'text' | 'image_url' | 'video_url' | 'audio_url', required — 内容类型，可以是文本、视频链接、音频链接或图片链接
      - `text` string — 当 `type` 为 `text` 时的文本内容
      - `image_url` object — 当 `type` 为 `image_url` 时的图片参数
        - `url` string — 当 `type` 为 `image_url` 时的图片链接地址
      - `video_url` object — 当 `type` 为 `video_url` 时的视频参数
        - `url` string — 当 `type` 为 `video_url` 时的视频链接地址
      - `audio_url` object — 当 `type` 为 `audio_url` 时的音频参数
        - `url` string — 当 `type` 为 `audio_url` 时的音频链接地址
    - object[] — 审核多模态内容数组，支持文本、文件和图片
      - `type` 'text' | 'image_url' | 'video_url' | 'audio_url' — 内容类型，可以是文本、视频链接、音频链接或图片链接
      - `text` string — 当 `type` 为 `text` 时的文本内容
      - `image_url` object — 当 `type` 为 `image_url` 时的图片参数
        - `url` string — 当 `type` 为 `image_url` 时的图片链接地址
      - `video_url` object — 当 `type` 为 `video_url` 时的视频参数
        - `url` string — 当 `type` 为 `video_url` 时的视频链接地址
      - `audio_url` object — 当 `type` 为 `audio_url` 时的音频参数
        - `url` string — 当 `type` 为 `audio_url` 时的音频链接地址

## Response `200`

业务处理成功

- ModerationResponse
  - `id` string — 任务 `ID`
  - `created` integer — 请求创建时间，是以秒为单位的 `Unix` 时间戳
  - `request_id` string — 请求标识符
  - `result_list` object[]
    - `content_type` string — 内容类型
    - `risk_level` 'PASS' | 'REVIEW' | 'BLOCK' | 'REJECT' | 'HIGH' — 检测结果，处置建议，可能返回值： PASS：正常，机审不拦截，建议直接放行 REVIEW：可疑，机审不拦截，建议人工后审 BLOCK：一般违规，建议机审拦截，但可以不终止本轮对话 REJECT：违规，建议机审拦截，并终止多轮对话 HIGH：高危，建议机审拦截，输入也要做回撤处理
    - `risk_type` string[] — 风险类型列表
  - `usage` object
    - `moderation_text` object
      - `call_count` number

## Other responses

- `default` — 请求失败。

---

[API](https://skmtc.net/bigmodel/apis/zhipu-ai-api.md) · [All operations](https://skmtc.net/bigmodel/apis/zhipu-ai-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/bigmodel/zhipu-ai-api/revisions/37de2d7b73de/schema)
