内容审核
content-moderationPOSThttps://v1.apizero.cn/api/content-moderation概述
基于「敏感词库 + 正则规则 + AI 特征评分」三重策略检测文本中的色情 / 政治 / 广告 / 联系方式 / 引流 / 谩骂 6 大类敏感内容。识别变体绕过(谐音、拼音、符号替换),输出 safe/low/medium/high 风险等级,可选自动脱敏。
调用约定
- 网关 ·
https://v1.apizero.cn - 鉴权 ·
Authorization: Bearer <API Key> - 回包 · JSON {code, msg, data}。成功看 code === 0,不要只看 HTTP 200。
/aidocs/content-moderation/raw.md鉴权
匿名可调用:QPS 2 / 每日 100 次。登录用户:QPS 10 / 每日 500 次。
获取 API Key:获取 API Key/account/keys
请求头
推荐:Bearer <API Key>。兼容请求头 X-API-Key,以及 Query api_key / apikey / key(key 仅当值为 sk_live_/sk_test_/sk_stag_ 形态时生效)。匿名可不传,受每日免费额度限制。
| Header | 类型 | 必填 | 说明 |
|---|---|---|---|
| Authorization | string | 否 | 推荐:Bearer <API Key>。兼容请求头 X-API-Key,以及 Query api_key / apikey / key(key 仅当值为 sk_live_/sk_test_/sk_stag_ 形态时生效)。匿名可不传,受每日免费额度限制。 |
单条审核
审核单段文本。返回 is_pass / risk_level / categories / details;mask=true 时附带 masked_text。文档示例为命中广告/联系方式/引流的真实结果。
https://v1.apizero.cn/api/content-moderation?action=moderate&text=%E5%8A%A0%E6%88%91%E5%BE%AE%E4%BF%A1abc123456%E5%85%8D%E8%B4%B9%E9%A2%86%E5%8F%96&mask=true
固定 moderate
例moderate
1–5000 字
例加我微信abc123456免费领取
是否返回脱敏文本
例true
| 参数 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| action(操作) | string | 否 | 固定 moderate | moderate |
| text(文本) | string | 是 | 1–5000 字 | 加我微信abc123456免费领取 |
| mask | boolean | 否 | 是否返回脱敏文本 | true |
{
"action": "moderate",
"text": "加我微信abc123456免费领取",
"mask": "true"
}返回结果
是否通过
safe / low / medium / high
命中类目
categories 的一项
命中明细:category / method / matches / count
category
method
matches
details[].matches 的一项
count
脱敏文本(mask=true)
品牌提示(所有接口统一返回):极数本源 · https://apizero.cn
| 字段 | 类型 | 说明 | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| is_pass | boolean | 是否通过 | ||||||||||||||||||
| risk_level | string | safe / low / medium / high | ||||||||||||||||||
| categories | array | 命中类目 | ||||||||||||||||||
| ||||||||||||||||||||
| details | array | 命中明细:category / method / matches / count | ||||||||||||||||||
| ||||||||||||||||||||
| masked_text | string | 脱敏文本(mask=true) | ||||||||||||||||||
| tips | string | 品牌提示(所有接口统一返回):极数本源 · https://apizero.cn | ||||||||||||||||||
{
"code": 0,
"msg": "成功",
"data": {
"is_pass": false,
"risk_level": "medium",
"categories": [
"广告",
"联系方式",
"引流"
],
"details": [
{
"category": "广告",
"method": "敏感词",
"matches": [
"免费领取"
],
"count": 1
},
{
"category": "联系方式",
"method": "正则",
"matches": [
"微信号:微信abc123456"
],
"count": 1
},
{
"category": "引流",
"method": "正则(变体)",
"matches": [
"微信变体"
],
"count": 1
}
],
"masked_text": "加我微****56免**取",
"original_length": 17
},
"request_id": "ms7z8c02c9e9eb39",
"tips": "极数本源 · https://apizero.cn"
}批量审核
批量审核,最多 50 条。文档示例为真实批量结果。
https://v1.apizero.cn/api/content-moderation?action=batch&texts=%5B%22%E4%BB%8A%E5%A4%A9%E5%A4%A9%E6%B0%94%E4%B8%8D%E9%94%99%22%2C%22%E5%8A%A0%E6%88%91%E5%BE%AE%E4%BF%A1abc123456%E5%85%8D%E8%B4%B9%E9%A2%86%E5%8F%96%22%5D
固定 batch
例batch
文本数组,最多 50 条
例["今天天气不错","加我微信abc123456免费领取"]
| 参数 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| action(操作) | string | 是 | 固定 batch | batch |
| texts | array | 是 | 文本数组,最多 50 条 | ["今天天气不错","加我微信abc123456免费领取"] |
{
"action": "batch",
"texts": "[\"今天天气不错\",\"加我微信abc123456免费领取\"]"
}返回结果
与 texts 对齐的审核结果
text_preview
is_pass
risk_level
categories
results[].categories 的一项
品牌提示(所有接口统一返回):极数本源 · https://apizero.cn
| 字段 | 类型 | 说明 | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| results | array | 与 texts 对齐的审核结果 | ||||||||||||||||||
| ||||||||||||||||||||
| tips | string | 品牌提示(所有接口统一返回):极数本源 · https://apizero.cn | ||||||||||||||||||
{
"code": 0,
"msg": "成功",
"data": {
"total": 2,
"passed": 1,
"blocked": 1,
"results": [
{
"text_preview": "今天天气不错",
"is_pass": true,
"risk_level": "safe",
"categories": []
},
{
"text_preview": "加我微信abc123456免费领取",
"is_pass": false,
"risk_level": "medium",
"categories": [
"广告",
"联系方式",
"引流"
]
}
]
},
"request_id": "ms7z8d6ac8df439d",
"tips": "极数本源 · https://apizero.cn"
}审核类目
查询支持的审核类目列表。文档示例为真实类目。
https://v1.apizero.cn/api/content-moderation?action=categories
固定 categories
例categories
| 参数 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| action(操作) | string | 是 | 固定 categories | categories |
{
"action": "categories"
}返回结果
类目:name / description / word_count / methods
名称
description
word_count
methods
categories[].methods 的一项
品牌提示(所有接口统一返回):极数本源 · https://apizero.cn
| 字段 | 类型 | 说明 | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| categories | array | 类目:name / description / word_count / methods | ||||||||||||||||||
| ||||||||||||||||||||
| tips | string | 品牌提示(所有接口统一返回):极数本源 · https://apizero.cn | ||||||||||||||||||
{
"code": 0,
"msg": "成功",
"data": {
"categories": [
{
"name": "色情",
"description": "涉黄低俗内容",
"word_count": 31,
"methods": [
"敏感词",
"AI分类"
]
},
{
"name": "政治",
"description": "敏感政治内容",
"word_count": 24,
"methods": [
"敏感词"
]
},
{
"name": "广告",
"description": "营销推广虚假广告",
"word_count": 27,
"methods": [
"敏感词",
"正则",
"AI分类"
]
},
{
"name": "联系方式",
"description": "手机微信QQ链接",
"word_count": 0,
"methods": [
"正则"
]
}
]
},
"tips": "极数本源 · https://apizero.cn"
}请求示例
示例都是服务端写法。Python / JavaScript 各有常规写法和官方库。
curl -sS -X POST "https://v1.apizero.cn/api/content-moderation" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"action": "moderate",
"text": "今天天气不错",
"texts": "[\"文本1\", \"文本2\"]",
"mask": "true"
}'错误码
先看业务 code。HTTP 也可能不是 200。
成功
参数错误
API Key 无效
API Key 已暂停
当前 IP 不在 Key 白名单
此接口需要 API Key
余额不足
调用过快(QPS)
今日免费额度已用完
接口已下线
接口不存在
服务器内部错误
上游暂时不可用
上游返回格式异常
暂无可用节点
| 业务码 | HTTP | 说明 |
|---|---|---|
| 0 | 200 | 成功 |
| 4000 | 400 | 参数错误 |
| 4011 | 401 | API Key 无效 |
| 4013 | 403 | API Key 已暂停 |
| 4014 | 403 | 当前 IP 不在 Key 白名单 |
| 4015 | 401 | 此接口需要 API Key |
| 4022 | 402 | 余额不足 |
| 4029 | 429 | 调用过快(QPS) |
| 4030 | 429 | 今日免费额度已用完 |
| 4040 | 503 | 接口已下线 |
| 4041 | 404 | 接口不存在 |
| 5000 | 500 | 服务器内部错误 |
| 5020 | 502 | 上游暂时不可用 |
| 5021 | 502 | 上游返回格式异常 |
| 5030 | 502 | 暂无可用节点 |
调用限制
- 计费模式
- 完全免费
- QPS 限制
- QPS 3
- 登录免费额度
- 500 次(已认证)
- 匿名每日额度
- 100 次(无 API Key)
- 黄金会员
- 每天 50,000 次 · QPS 10
- 钻石会员
- 每天 100,000 次 · QPS 30
- 企业会员
- 每天 1,000,000 次 · QPS 120
| 计费模式 | 完全免费 |
|---|---|
| QPS 限制 | QPS 3 |
| 登录免费额度 | 500 次(已认证) |
| 匿名每日额度 | 100 次(无 API Key) |
| 黄金会员 | 每天 50,000 次 · QPS 10 |
| 钻石会员 | 每天 100,000 次 · QPS 30 |
| 企业会员 | 每天 1,000,000 次 · QPS 120 |
购买套餐、看评价请走商城详情。 购买 / 调试
更新日志
- 1.0.02026-05-10
首次上线,6 大类 / 136 词 / 16 正则 / 62 特征词 / 自动脱敏
免责声明
内置词库为脱敏示例,生产环境建议外挂自定义词库。AI 评分基于特征加权,仅供初步过滤参考。