AIHumanizer

开发者

将 AI 文本检测接入你的工作流程

AIHumanizer API 分析英文文本,返回整篇评分、按阈值划分的判断和逐句评分。它可辅助审阅流程,但估计结果无法证明作者身份或不当行为。

管理 API 密钥

身份验证与限制

仅通过服务器发送 Authorization: Bearer <API_KEY>。密钥拥有账户的积分使用权限;请勿将密钥放入客户端代码、URL 或公共代码库。可在设置中创建和撤销密钥。

每个密钥每 2 秒最多请求一次。每次请求最多 5,000 个英文单词、100,000 个字符;管理员可降低单词上限。托管检测供应商要求至少 300 个字符,自行配置的 Modal 端点可能接受更短文本。JSON 请求体最大为 450,000 字节。

每 100 个单词收取 1 积分,不足 100 个按 100 个计算。失败或超时会退回已扣积分。响应同步返回,最多等待 25 秒;不会自动重试。

此应用的 API 不会为提交的文本创建扫描记录,也不会将原文写入日志。文本会发送给已配置的检测供应商,其保留数据及训练相关规则同样适用。内置公开示例可能使用缓存结果。提交机密材料前,请先核对供应商条款。


POST /api/v1/detect

请求体为 { text: string }。请保留原始文本,以便使用响应中的字符偏移。

以下示例中的英文是供检测工具处理的输入示例,请替换为你想检测的英文文本。

curl

curl
curl "https://tryaihumanizer.com/api/v1/detect" \  -H "Authorization: Bearer $API_KEY" \  -H "Content-Type: application/json" \  --data '{"text":"Our editing team reviews each draft before publication. We compare names, dates and quotations with the source material, then ask the writer to explain any passage that needs more context. A detector score can help us choose where to begin that conversation, but it does not tell us who wrote the text. We keep earlier drafts and use human judgment when deciding which changes to accept."}'

JavaScript (Node.js)

JavaScript
// 请在服务器上运行,请勿将 API 密钥放入浏览器代码。const response = await fetch("https://tryaihumanizer.com/api/v1/detect", {  method: 'POST',  headers: {    Authorization: `Bearer ${process.env.API_KEY}`,    'Content-Type': 'application/json',  },  body: JSON.stringify({ text: "Our editing team reviews each draft before publication. We compare names, dates and quotations with the source material, then ask the writer to explain any passage that needs more context. A detector score can help us choose where to begin that conversation, but it does not tell us who wrote the text. We keep earlier drafts and use human judgment when deciding which changes to accept." }),});const result = await response.json();if (!response.ok || result.code !== 0) {  throw new Error(result.message);}console.log(result.data.verdict, result.data.docScore);

Python

Python
# 请在服务器上运行,请勿将 API 密钥放入浏览器代码。import jsonimport osfrom urllib.error import HTTPErrorfrom urllib.request import Request, urlopenrequest = Request(    "https://tryaihumanizer.com/api/v1/detect",    data=json.dumps({"text": "Our editing team reviews each draft before publication. We compare names, dates and quotations with the source material, then ask the writer to explain any passage that needs more context. A detector score can help us choose where to begin that conversation, but it does not tell us who wrote the text. We keep earlier drafts and use human judgment when deciding which changes to accept."}).encode("utf-8"),    headers={        "Authorization": f"Bearer {os.environ['API_KEY']}",        "Content-Type": "application/json",    },    method="POST",)try:    with urlopen(request, timeout=30) as response:        result = json.load(response)    if result["code"] != 0:        raise RuntimeError(result["message"])    print(result["data"]["verdict"], result["data"]["docScore"])except HTTPError as error:    raise RuntimeError(error.read().decode("utf-8")) from error

响应

成功响应的 code 为 0,结果在 data 中。docScore 和 sentence.score 是 0 到 1 的检测估计值,分数越高,表示 AI 式写作信号越明显。分数不是 AI 撰写的词数占比,也不能证明作者身份。verdict 按配置的阈值分为 human、uncertain 或 ai。字符偏移使用 JavaScript UTF-16 索引。

JSON
{  "code": 0,  "message": "ok",  "data": {    "status": "done",    "verdict": "uncertain",    "docScore": 0.5,    "wordCount": 3,    "modelVersion": "configured-model-version",    "sentences": [      {        "start": 0,        "end": 15,        "text": "Text to review.",        "score": 0.5,        "verdict": "uncertain"      }    ],    "l1": {      "wordCount": 3,      "sentenceCount": 1,      "score": 0,      "band": "low",      "signals": [],      "phrases": [],      "hints": []    }  }}

以上数值仅用于展示响应结构,不代表任何文本的实际检测结果。L1 信息是规则解释,不是检测结论。


错误

错误响应包含 code: -1 和可读的 message。

400
JSON 无效、文本为空、使用托管供应商时不足 300 个字符,或输入超过长度限制。
401
API 密钥缺失、无效或已撤销。
402
可用积分不足。
429
请求过于频繁,请遵循 Retry-After 响应头。
502 / 503
检测服务不可用或尚未配置。
504
检测未在 25 秒内完成,已扣积分会退回。