AI文本违规检测

GETPOST AI 工具 AI文本审核违规检测内容安全

AI文本违规检测 — 一键检测文本是否违规,覆盖色情、暴力、仇恨言论、政治敏感、辱骂、垃圾信息、诈骗、隐私泄露8大类别,返回详细风险评分和处理建议

GET https://api.tinyaii.cn/v1/text/detect

请求参数

参数名类型必填说明示例
textstring必填待检测文本(最多5000字符)你好世界
langstring可选回答语言,zh=中文(默认),en=英文zh

返回字段

字段类型说明
flaggedboolean是否违规(true/false)
verdictstring鉴定结论:安全/违规/疑似违规
confidencenumber置信度(0-100)
risk_levelstring风险等级:安全/低危/中危/高危/严重
overall_scorenumber综合风险评分(0-100,越高越危险)
categoriesobject核心检测类别,含politic/porn/insult/violence,值为安全/低/中/高
category_scoresobject核心检测指数,含politic/porn/insult/violence,值为0-100整数
detail_categoriesobject8大类别详细检测:色情/暴力/仇恨言论/政治敏感/辱骂/垃圾信息/诈骗/隐私泄露,各含detected/score/description
flagged_segmentsarray违规片段列表,含text/category/severity/reason
analysisstring详细分析总结
suggestionstring处理建议
text_lengthnumber文本长度

返回示例

{
  "code": 200,
  "message": "success",
  "data": {
    "flagged": false,
    "verdict": "安全",
    "confidence": 98,
    "risk_level": "安全",
    "overall_score": 0,
    "categories": {
      "politic": "安全",
      "porn": "安全",
      "insult": "安全",
      "violence": "安全"
    },
    "category_scores": {
      "politic": 0,
      "porn": 0,
      "insult": 0,
      "violence": 0
    },
    "detail_categories": {
      "色情": {
        "detected": false,
        "score": 0,
        "description": "无色情内容"
      },
      "暴力": {
        "detected": false,
        "score": 0,
        "description": "无暴力内容"
      },
      "仇恨言论": {
        "detected": false,
        "score": 0,
        "description": "无仇恨言论"
      },
      "政治敏感": {
        "detected": false,
        "score": 0,
        "description": "无政治敏感内容"
      },
      "辱骂": {
        "detected": false,
        "score": 0,
        "description": "无辱骂内容"
      },
      "垃圾信息": {
        "detected": false,
        "score": 0,
        "description": "无垃圾信息"
      },
      "诈骗": {
        "detected": false,
        "score": 0,
        "description": "无诈骗内容"
      },
      "隐私泄露": {
        "detected": false,
        "score": 0,
        "description": "无隐私泄露"
      }
    },
    "flagged_segments": [],
    "analysis": "文本内容为普通问候语,不包含任何违规信息。",
    "suggestion": "内容安全,可正常发布。",
    "text_length": 12
  }
}

调用示例

curl "https://api.tinyaii.cn/v1/text/detect?text=你好世界" \
  -H "Authorization: Bearer YOUR_API_KEY"
const res = await fetch("https://api.tinyaii.cn/v1/text/detect?text=你好世界", {
  headers: { "Authorization": "Bearer YOUR_API_KEY" },
});
console.log(await res.json());
import requests

resp = requests.get(
    "https://api.tinyaii.cn/v1/text/detect",
    params={"text": "你好世界"},
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    timeout=10,
)
print(resp.json())

把 YOUR_API_KEY 换成你的密钥即可直接运行。密钥只保存在你自己的设备上。