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

# EvoLink Moderation 1.0 - 完整参数文档

> - 同步接口，对输入的**文本**和/或**图像**进行 13 个维度的有害内容检测
- 响应中通过 `evolink_summary` 字段返回 `risk_level` / `flagged` / `violations` / `max_score` / `max_category` 五项统一摘要

**核心能力**：
- **多模态审核**：支持纯文本、纯图像、文本+图像组合输入
- **13 个分类**：harassment、hate、sexual、violence、self-harm、illicit、sexual/minors 等
- **风险分级**：每个类别独立设定 medium / high 阈值，按敏感度差异化判定（红线类别 sexual/minors 阈值最严）
- **可解释**：响应同时返回逐类别 `category_scores` 与简化的 `evolink_summary`，业务可二选一使用

**输入限制**：
- 单次请求最多 1 张图片（如需审核多张图，请并发拆请求）
- 图片仅支持 HTTPS URL 输入

**典型用法**：参考下方示例，覆盖纯文本、文本+图像、纯图像三种典型场景。

<Note>
  **BaseURL 说明**：默认 BaseURL 为 `https://direct.evolink.ai`，对文本模型支持更好，支持长连接；`https://api.evolink.ai` 是多模态主力地址，对文本模型作为备用地址使用。
</Note>


## OpenAPI

````yaml cn/api-manual/language-series/evolink-moderation-1.0/evolink-moderation-1.0-api.json POST /v1/moderations
openapi: 3.1.0
info:
  title: EvoLink Moderation 1.0 完整参数文档
  description: >-
    EvoLink 内容审核接口，对文本和图像进行有害内容检测，并通过 `evolink_summary`
    字段返回统一的风险摘要，便于业务侧一眼判断风险等级。
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://direct.evolink.ai
    description: 生产环境（推荐）
  - url: https://api.evolink.ai
    description: 备用地址
security:
  - bearerAuth: []
tags:
  - name: 内容审核
    description: EvoLink 内容审核接口（文本+图像）
paths:
  /v1/moderations:
    post:
      tags:
        - 内容审核
      summary: EvoLink Moderation 内容审核接口
      description: >-
        - 同步接口，对输入的**文本**和/或**图像**进行 13 个维度的有害内容检测

        - 响应中通过 `evolink_summary` 字段返回 `risk_level` / `flagged` / `violations` /
        `max_score` / `max_category` 五项统一摘要


        **核心能力**：

        - **多模态审核**：支持纯文本、纯图像、文本+图像组合输入

        - **13
        个分类**：harassment、hate、sexual、violence、self-harm、illicit、sexual/minors 等

        - **风险分级**：每个类别独立设定 medium / high 阈值，按敏感度差异化判定（红线类别 sexual/minors 阈值最严）

        - **可解释**：响应同时返回逐类别 `category_scores` 与简化的 `evolink_summary`，业务可二选一使用


        **输入限制**：

        - 单次请求最多 1 张图片（如需审核多张图，请并发拆请求）

        - 图片仅支持 HTTPS URL 输入


        **典型用法**：参考下方示例，覆盖纯文本、文本+图像、纯图像三种典型场景。
      operationId: createModeration
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ModerationRequest'
            examples:
              moderate_text:
                summary: 纯文本审核
                value:
                  model: evolink-moderation-1.0
                  input:
                    - type: text
                      text: I want to kill them.
              moderate_image_url:
                summary: 纯图像审核
                value:
                  model: evolink-moderation-1.0
                  input:
                    - type: image_url
                      image_url:
                        url: https://example.com/image.png
              moderate_text_and_image:
                summary: 文本 + 图像组合审核（推荐）
                value:
                  model: evolink-moderation-1.0
                  input:
                    - type: text
                      text: 请帮我描述这张图片的场景
                    - type: image_url
                      image_url:
                        url: https://example.com/image.png
      responses:
        '200':
          description: 审核成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModerationResponse'
              example:
                evolink_summary:
                  risk_level: medium
                  flagged: false
                  violations: []
                  max_score: 0.597383272
                  max_category: sexual
                id: modr-0d9740456c391e43c445bf0f010940c7
                model: evolink-moderation-1.0
                results:
                  - flagged: false
                    categories:
                      harassment: false
                      harassment/threatening: false
                      hate: false
                      hate/threatening: false
                      illicit: false
                      illicit/violent: false
                      self-harm: false
                      self-harm/intent: false
                      self-harm/instructions: false
                      sexual: false
                      sexual/minors: false
                      violence: false
                      violence/graphic: false
                    category_scores:
                      harassment: 0.0006
                      harassment/threatening: 0.0007
                      hate: 0.00003
                      hate/threatening: 0.0000025
                      illicit: 0.000013
                      illicit/violent: 0.0000096
                      self-harm: 0.0000166
                      self-harm/intent: 0.000004
                      self-harm/instructions: 0.0000031
                      sexual: 0.597383272
                      sexual/minors: 0.000004
                      violence: 0.0231
                      violence/graphic: 0.0089
                    category_applied_input_types:
                      harassment:
                        - text
                      harassment/threatening:
                        - text
                      hate:
                        - text
                      hate/threatening:
                        - text
                      illicit:
                        - text
                      illicit/violent:
                        - text
                      self-harm:
                        - text
                      self-harm/intent:
                        - text
                      self-harm/instructions:
                        - text
                      sexual:
                        - text
                      sexual/minors:
                        - text
                      violence:
                        - text
                      violence/graphic:
                        - text
        '400':
          description: 请求参数错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 400
                  message: field input is required
                  type: invalid_request_error
                  param: input
        '401':
          description: 未认证、Token 无效或过期
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 401
                  message: Invalid or expired token
                  type: authentication_error
        '402':
          description: 配额不足，需要充值
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 402
                  message: Insufficient quota
                  type: insufficient_quota_error
                  fallback_suggestion: https://evolink.ai/dashboard/billing
        '403':
          description: 无权限访问该模型
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 403
                  message: Access denied for this model
                  type: permission_error
                  param: model
        '404':
          description: 资源不存在
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 404
                  message: Specified model not found
                  type: not_found_error
                  param: model
                  fallback_suggestion: evolink-moderation-1.0
        '413':
          description: 请求体过大（图片文件超过限制）
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 413
                  message: Image file too large
                  type: request_too_large_error
                  param: input
                  fallback_suggestion: compress image to under 20MB
        '429':
          description: 请求频率超限
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 429
                  message: Rate limit exceeded
                  type: rate_limit_error
                  fallback_suggestion: retry after 60 seconds
        '500':
          description: 服务器内部错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 500
                  message: Internal server error
                  type: internal_server_error
                  fallback_suggestion: try again later
        '502':
          description: 网关错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 502
                  message: Bad gateway
                  type: bad_gateway_error
                  fallback_suggestion: try again later
        '503':
          description: 服务暂时不可用
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 503
                  message: Service temporarily unavailable
                  type: service_unavailable_error
                  fallback_suggestion: retry after 30 seconds
components:
  schemas:
    ModerationRequest:
      type: object
      required:
        - model
        - input
      properties:
        model:
          type: string
          description: 审核模型名称，固定为 `evolink-moderation-1.0`
          enum:
            - evolink-moderation-1.0
          example: evolink-moderation-1.0
        input:
          type: array
          description: |-
            待审核的内容，统一为对象数组形式。每个元素是一个 `text` 或 `image_url` 对象。

            ```json
            "input": [
              {"type": "text", "text": "待审核文本"},
              {"type": "image_url", "image_url": {"url": "https://..."}}
            ]
            ```

            **限制**：
            - 数组中 `type=image_url` 的对象**最多 1 个**，如需审核多张图请并发拆请求
            - `type=text` 的对象数量不限
          items:
            $ref: '#/components/schemas/ModerationContentItem'
    ModerationResponse:
      type: object
      description: 审核响应。最上层的 `evolink_summary` 是业务侧推荐使用的统一风险摘要；`results` 提供逐类别明细分数。
      properties:
        evolink_summary:
          $ref: '#/components/schemas/EvolinkSummary'
        id:
          type: string
          description: 本次审核请求的唯一标识符
          example: modr-0d9740456c391e43c445bf0f010940c7
        model:
          type: string
          description: 实际使用的模型名称，固定为 `evolink-moderation-1.0`
          example: evolink-moderation-1.0
        results:
          type: array
          description: >-
            审核结果列表。固定返回 **1 个** result（数组形式输入会合并为单次打分）。


            ## 多模态评估范围


            13 个类别中，部分类别**仅在文本上评估**，不会评估图像：


            | 类别 | 评估范围 |

            |------|----------|

            | `harassment` / `harassment/threatening` | 仅文本 |

            | `hate` / `hate/threatening` | 仅文本 |

            | `illicit` / `illicit/violent` | 仅文本 |

            | `sexual/minors` | **仅文本（红线类别需注意）** |

            | `self-harm` / `self-harm/intent` / `self-harm/instructions` | 文本 +
            图像 |

            | `sexual` | 文本 + 图像 |

            | `violence` / `violence/graphic` | 文本 + 图像 |


            **关键事实**：

            - 仅传图片时，上述 7 个仅文本类别的分数恒为 `0`、`category_applied_input_types`
            为空数组——**这不代表内容安全，只代表未评估**

            - 业务若涉及未成年人风险（`sexual/minors` 红线类别），**必须配合文本上下文一起送审**，不能只依赖图像分数
          items:
            $ref: '#/components/schemas/ModerationResult'
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: integer
              description: HTTP 状态错误代码
            message:
              type: string
              description: 错误描述信息
            type:
              type: string
              description: 错误类型
            param:
              type: string
              description: 相关参数名称
            fallback_suggestion:
              type: string
              description: 错误时的建议
    ModerationContentItem:
      oneOf:
        - $ref: '#/components/schemas/TextInputItem'
        - $ref: '#/components/schemas/ImageInputItem'
    EvolinkSummary:
      type: object
      description: >-
        **EvoLink 风险摘要**：基于 13 个类别的
        `category_scores`，按各类别敏感度差异化阈值算出的统一摘要。业务可直接据此放行/拒绝/送审。


        ## 风险分级阈值表


        | 类别 | medium 阈值 | high 阈值 | 说明 |

        |------|-----------|----------|------|

        | `sexual/minors` | 0.05 | 0.20 | **红线类别**，阈值最严 |

        | `self-harm` / `self-harm/intent` / `self-harm/instructions` | 0.30 |
        0.60 | 涉及人命，严格 |

        | `violence/graphic` | 0.40 | 0.70 | 血腥暴力 |

        | `illicit/violent` | 0.40 | 0.70 | 暴力违法 |

        | `sexual` | 0.50 | 0.80 | 普通色情 |

        | `violence` | 0.50 | 0.80 | 普通暴力 |

        | `harassment/threatening` | 0.50 | 0.80 | 威胁性骚扰 |

        | `hate/threatening` | 0.50 | 0.80 | 威胁性仇恨 |

        | `harassment` | 0.60 | 0.85 | 普通骚扰 |

        | `hate` | 0.60 | 0.85 | 普通仇恨 |

        | `illicit` | 0.60 | 0.85 | 普通违法指引 |


        ## 判定规则


        ```

        任意类别 score >= 该类别 high 阈值   → risk_level = "high",   flagged = true,  加入
        violations

        任意类别 score >= 该类别 medium 阈值 → risk_level = "medium", flagged = false

        否则                                 → risk_level = "low",    flagged =
        false

        ```


        ## 业务侧使用建议


        ```python

        summary = response["evolink_summary"]


        if summary["flagged"]:                         # high → 直接拒绝
            reject(reason=summary["violations"])
        elif summary["risk_level"] == "medium":        # 灰色地带
            log_for_review(summary)                    # 记录日志，人工抽查
            proceed()
        else:                                          # low → 放行
            proceed()
        ```
      properties:
        risk_level:
          type: string
          description: |-
            风险等级

            - `low`：所有类别均低于 medium 阈值
            - `medium`：至少一个类别越过 medium 阈值，但未越过 high 阈值
            - `high`：至少一个类别越过 high 阈值（红线）
          enum:
            - low
            - medium
            - high
          example: medium
        flagged:
          type: boolean
          description: >-
            是否触发拒绝建议。


            等价于 `risk_level == "high"`。**业务上推荐直接据此判定放行/拒绝**。


            注意：本字段与 `results[].flagged` 不同——`results[].flagged`
            是任意类别越线的全局布尔，本字段基于 EvoLink 分级阈值，按敏感度差异化判定，更可控。
          example: false
        violations:
          type: array
          description: >-
            **触发 high 阈值的类别列表**。


            - 当 `risk_level == "high"` 时，此数组列出所有越过 high 阈值的类别名（如
            `["sexual/minors", "violence"]`）

            - 当 `risk_level == "medium"` 或 `"low"` 时，此数组为空 `[]`
          items:
            type: string
          example:
            - sexual/minors
        max_score:
          type: number
          description: 13 个类别中最大分数值（0~1）。可用于业务监控、阈值调优。
          minimum: 0
          maximum: 1
          example: 0.597383272
        max_category:
          type: string
          description: 最大分数对应的类别名（13 个类别之一）
          example: sexual
    ModerationResult:
      type: object
      description: 单个输入的审核结果
      properties:
        flagged:
          type: boolean
          description: >-
            全局违规标志：当 `categories` 中任意类别为 true 时，本字段为 true。


            **业务侧建议优先使用 `evolink_summary.flagged`**——它基于 EvoLink
            平台分级阈值判定，逻辑更细、更可控，本字段更适合作为兜底参考。
          example: false
        categories:
          $ref: '#/components/schemas/ModerationCategories'
        category_scores:
          $ref: '#/components/schemas/ModerationCategoryScores'
        category_applied_input_types:
          $ref: '#/components/schemas/ModerationCategoryAppliedInputTypes'
    TextInputItem:
      title: 文本输入项
      type: object
      required:
        - type
        - text
      properties:
        type:
          type: string
          enum:
            - text
          description: 内容类型固定为 `text`
        text:
          type: string
          description: 待审核的文本
          example: 请帮我描述这张图片的场景
    ImageInputItem:
      title: 图像输入项
      type: object
      required:
        - type
        - image_url
      properties:
        type:
          type: string
          enum:
            - image_url
          description: 内容类型固定为 `image_url`
        image_url:
          type: object
          required:
            - url
          properties:
            url:
              type: string
              format: uri
              description: |-
                图像的 HTTPS URL，例如：`https://example.com/image.png`

                **支持格式**：`.jpeg` / `.jpg` / `.png` / `.webp`

                **大小限制**：建议单张图片 ≤ 20MB（过大可能触发 413）

                **注意**：单次请求最多 1 张图，多张请并发拆分
              example: https://example.com/image.png
    ModerationCategories:
      type: object
      description: 13 个类别的违规布尔标识
      properties:
        harassment:
          type: boolean
          description: 骚扰：表达、煽动或助长针对任何目标的骚扰性语言
        harassment/threatening:
          type: boolean
          description: 威胁性骚扰：包含暴力或严重伤害的骚扰内容
        hate:
          type: boolean
          description: 仇恨：基于种族、性别、民族、宗教、国籍、性取向、残疾或种姓的仇恨性内容
        hate/threatening:
          type: boolean
          description: 威胁性仇恨：仇恨内容并伴随对被针对群体的暴力或严重伤害
        illicit:
          type: boolean
          description: 违法行为：提供违法行为的指导或建议（如「如何盗窃」）
        illicit/violent:
          type: boolean
          description: 暴力违法：违法内容中包含暴力或武器获取建议
        self-harm:
          type: boolean
          description: 自残：宣传、鼓励或描述自残行为（自杀、割伤、饮食失调等）
        self-harm/instructions:
          type: boolean
          description: 自残指引：鼓励或指导如何实施自残的内容
        self-harm/intent:
          type: boolean
          description: 自残意图：表达自身正在或意图实施自残的内容
        sexual:
          type: boolean
          description: 色情：用于性挑逗的内容（性教育与健康除外）
        sexual/minors:
          type: boolean
          description: 未成年色情（**红线类别**）：涉及未满 18 岁个体的色情内容
        violence:
          type: boolean
          description: 暴力：描绘死亡、暴力或人身伤害
        violence/graphic:
          type: boolean
          description: 血腥暴力：以图像化细节描绘死亡、暴力或人身伤害
    ModerationCategoryScores:
      type: object
      description: 13 个类别的置信度分数（0~1，越高越违规）
      properties:
        harassment:
          type: number
          description: harassment 的置信度
          example: 0.0006
        harassment/threatening:
          type: number
          description: harassment/threatening 的置信度
          example: 0.0007
        hate:
          type: number
          description: hate 的置信度
          example: 0.00003
        hate/threatening:
          type: number
          description: hate/threatening 的置信度
          example: 0.0000025
        illicit:
          type: number
          description: illicit 的置信度
          example: 0.000013
        illicit/violent:
          type: number
          description: illicit/violent 的置信度
          example: 0.0000096
        self-harm:
          type: number
          description: self-harm 的置信度
          example: 0.0000166
        self-harm/instructions:
          type: number
          description: self-harm/instructions 的置信度
          example: 0.0000031
        self-harm/intent:
          type: number
          description: self-harm/intent 的置信度
          example: 0.000004
        sexual:
          type: number
          description: sexual 的置信度
          example: 0.5973
        sexual/minors:
          type: number
          description: sexual/minors 的置信度
          example: 0.000004
        violence:
          type: number
          description: violence 的置信度
          example: 0.0231
        violence/graphic:
          type: number
          description: violence/graphic 的置信度
          example: 0.0089
    ModerationCategoryAppliedInputTypes:
      type: object
      description: |-
        每个类别**实际评估了哪些输入类型**。值是一个数组，元素为 `text` 或 `image`。

        各类别的评估范围（仅文本 / 文本+图像）已在 `results` 字段说明中给出对照表，此处的数组为本次请求中**实际命中**的输入类型。
      properties:
        harassment:
          type: array
          description: harassment 评估的输入类型（仅 text）
          items:
            type: string
            enum:
              - text
        harassment/threatening:
          type: array
          items:
            type: string
            enum:
              - text
        hate:
          type: array
          items:
            type: string
            enum:
              - text
        hate/threatening:
          type: array
          items:
            type: string
            enum:
              - text
        illicit:
          type: array
          items:
            type: string
            enum:
              - text
        illicit/violent:
          type: array
          items:
            type: string
            enum:
              - text
        self-harm:
          type: array
          items:
            type: string
            enum:
              - text
              - image
        self-harm/instructions:
          type: array
          items:
            type: string
            enum:
              - text
              - image
        self-harm/intent:
          type: array
          items:
            type: string
            enum:
              - text
              - image
        sexual:
          type: array
          items:
            type: string
            enum:
              - text
              - image
        sexual/minors:
          type: array
          description: sexual/minors 仅支持 text
          items:
            type: string
            enum:
              - text
        violence:
          type: array
          items:
            type: string
            enum:
              - text
              - image
        violence/graphic:
          type: array
          items:
            type: string
            enum:
              - text
              - image
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: |-
        ##所有接口均需要使用 Bearer Token 进行认证##

        **获取 API Key：**

        访问 [API Key 管理页面](https://evolink.ai/dashboard/keys) 获取您的 API Key

        **使用时在请求头中添加：**
        ```
        Authorization: Bearer YOUR_API_KEY
        ```

````