<!-- AI ASSISTANT INSTRUCTIONS: This document describes a public HTTP API endpoint
provided by 极数本源 (https://apizero.cn). When a user asks you to use this API, read the
full documentation below carefully (request method, parameters, response fields,
error codes, examples), then generate working code in the user's preferred language.
API Key acquisition: https://apizero.cn/account/keys -->

# 内容审核

> 基于「敏感词库 + 正则规则 + AI 特征评分」三重策略检测文本中的色情 / 政治 / 广告 / 联系方式 / 引流 / 谩骂 6 大类敏感内容。识别变体绕过（谐音、拼音、符号替换），输出 safe/low/medium/high 风险等级，可选自动脱敏。

## 1. 基本信息

| 字段 | 值 |
| --- | --- |
| 接口标识 | `content-moderation` |
| 接口名称 | 内容审核 |
| 接口地址 | `https://v1.apizero.cn/api/content-moderation` |
| 请求方法 | `POST` |
| 分类 | content |
| 提供方 | 极数本源 |
| 计费模式 | 免费试用 |
| 单次消耗 | 0 积分 |
| 起步价 | — |
| QPS 限制 | 10 req/s |
| 每日免费额度 | 500 次（已认证用户） |
| 匿名每日额度 | 100 次（无 API Key） |
| VIP 免费 | 否 |
| 调用总次数 | undefined |

## 2. 认证

匿名可调用：QPS 2 / 每日 100 次。登录用户：QPS 10 / 每日 500 次。

获取 API Key：登录 `https://apizero.cn/account/keys` 申请。

## 3. 请求参数

| 参数 | 类型 | 必填 | 说明 | 示例 |
| --- | --- | --- | --- | --- |
| `action` | `string` | 否 | 操作：moderate（默认）/ batch / categories | `moderate` |
| `text` | `string` | 是 | 待审核文本（仅 action=moderate 用），1-5000 字 | `今天天气不错` |
| `texts` | `array` | 否 | 批量文本（仅 action=batch 用），最多 50 条 | `["文本1", "文本2"]` |
| `mask` | `boolean` | 否 | 是否返回脱敏文本，默认 false | `true` |

## 4. 请求头

| Header | 类型 | 必填 | 说明 | 示例 |
| --- | --- | --- | --- | --- |
| `Authorization` | `string` | 否 | — | — |

## 5. 请求示例 (cURL)

```bash
curl -X POST "https://v1.apizero.cn/api/content-moderation" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "action": "moderate",
  "text": "今天天气不错",
  "texts": "[\"文本1\", \"文本2\"]",
  "mask": "true"
}'
```

## 6. 响应字段

| 字段 | 类型 | 说明 | 示例 |
| --- | --- | --- | --- |
| `is_pass` | `boolean` | 是否通过审核 | — |
| `risk_level` | `string` | 风险等级：safe / low / medium / high | — |
| `categories` | `array` | 命中的类别列表 | — |
| `details` | `array` | 详细命中信息（含 category/method/matches/count） | — |
| `masked_text` | `string\|null` | 脱敏后文本（仅 mask=true 时返回） | — |
| `original_length` | `number` | 原文长度 | — |

## 7. 响应示例

```json
{
    "code": 0,
    "msg": "成功",
    "data": {
        "is_pass": false,
        "risk_level": "high",
        "categories": [
            "谩骂"
        ],
        "details": [
            {
                "category": "谩骂",
                "method": "敏感词",
                "matches": [
                    "傻逼",
                    "脑残"
                ],
                "count": 2
            }
        ],
        "masked_text": "你这个**，**吧",
        "original_length": 10
    },
    "request_id": "abc123"
}
```

## 8. 错误码

| code | status | 说明 |
| --- | --- | --- |
| `4000` | `—` | text 缺失 / 文本超长 / texts 数量超限 / action 不合法 |
| `4029` | `—` | 调用过快（QPS 超限） |
| `4030` | `—` | 今日额度用完 |

## 9. 变更日志

- **1.0.0** (2026-05-10)
  - 首次上线，6 大类 / 136 词 / 16 正则 / 62 特征词 / 自动脱敏

---

**极数本源** · 全部 API: `https://apizero.cn/aidocs` · 人类版本：`https://apizero.cn/marketplace/content-moderation`

Source: `https://apizero.cn/aidocs/content-moderation/raw.md`
Last updated: 2026-05-12T00:35:07+08:00
