API
一个请求,逐句 AI 检测。
发英文文本过来,返回 AI 率和每一句的分数;也可以改语法错误,或查 Corpus.Ink 的真实例句。适合 Agent 和程序自动调用:API 只扣点数包的点数。
鉴权
在工作台的 API 密钥里创建密钥,放在 Bearer 令牌里发送。密钥请妥善保管,随时可以停用。
检测一段文本
textstring中、英、日、韩、西、法、德、葡、意、俄、阿、印尼文本:至少 50 词,中日韩文至少 120 字,最多 5,000 点。
modestring"document"(只给总分,点数减半)或 "sentences"(含逐句分数,每个词或每 2 个中日韩文字 1 点)。默认 "document"。
titlestring可选,显示在检测记录里。
curl https://wofo.ink/api/v1/detect \
-H "Authorization: Bearer $WOFO_INK_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "Your English text…", "mode": "sentences"}'import os, requests
r = requests.post(
"https://wofo.ink/api/v1/detect",
headers={"Authorization": f"Bearer {os.environ['WOFO_INK_KEY']}"},
json={"text": text, "mode": "sentences"},
timeout=300,
)
r.raise_for_status()
print(r.json()["ai_rate"])返回
{
"id": "6f1c…",
"ai_rate": 64,
"verdict": "mixed",
"model": "DetectInk 2.1",
"mode": "sentences",
"words": 524,
"credits_charged": 524,
"credits_remaining": 39476,
"sentences": [
{ "start": 0, "end": 87, "ai_rate": 12, "text": "…" },
…
]
}查 API 可用点数
curl https://wofo.ink/api/v1/balance \
-H "Authorization: Bearer $WOFO_INK_KEY"
{ "credits_remaining": 39476 }语法纠错
textstring英文文本,最多 5,000 词。整篇一次发过来;主要不是英文的段落不查、不扣点。
levelstring提示多少:"conservative"(只提有把握的)、"standard" 或 "aggressive"(提得更多)。默认 "standard"。
dialectstring拼写:"us"(美式)或 "gb"(英式)。默认 "us"。
languagestring讲解用的语言:"en" 或 "zh"。默认 "en"。
curl https://wofo.ink/api/v1/grammar \
-H "Authorization: Bearer $WOFO_INK_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "My friend and me goes to school."}'返回
{
"words": 7,
"corrected": "My friend and I go to school.",
"edits": [
{
"start": 14,
"end": 21,
"original": "me goes",
"replacement": "I go",
"severity": "required",
"category": "Pronouns",
"explanation": null
},
…
],
"credits_charged": 7,
"credits_remaining": 39469
}查 Corpus.Ink
qstring要查的英文说法,最多 200 个字符。
catstring可选:news、academic 或 wiki;不填为全部来源。
modestring可选:exact(原样)或 similar(相近说法)只返回这一组;不填两组都给。
offsetnumber可选:跳过前面多少句,用来翻页(最多 490)。
curl "https://wofo.ink/api/v1/corpus?q=in+light+of&cat=academic" \
-H "Authorization: Bearer $WOFO_INK_KEY"
{
"q": "in light of",
"exact": { "count": 18400, "approx": true, "items": [
{ "s": "In light of these findings, …", "site": "…", "date": "2021-05-03", "url": "https://…", "cat": "academic" },
…
] },
"similar": { "count": 2100, "approx": true, "items": [ … ] },
"credits_charged": 20,
"credits_remaining": 39194
}错误
| 状态码 | 错误码 | 含义 |
|---|---|---|
| 401 | missing_api_key / invalid_api_key | 没带密钥或密钥无效。 |
| 402 | insufficient_credits | 点数包的点数不够。 |
| 400 | too_short | 不到 50 个词,中日韩文也不到 120 个字。 |
| 400 | too_long | 超过 5,000 词。 |
| 400 | unsupported_language | 只支持中文、英文、日语、韩语、西班牙语、法语、德语、葡萄牙语、意大利语、俄语、阿拉伯语和印尼语。 |
| 403 | account_disabled | 账号已停用。 |
| 400 | empty_query / query_too_long | q 为空或超过 200 个字符。 |
| 400 | no_english / sentence_too_long | 语法纠错:没有英文,或有一句超过 400 词。 |
| 429 | rate_limited | 这个密钥一分钟内查 Corpus.Ink 超过 60 次。 |
限制和计费
检测:每次至少 50 词,中日韩文至少 120 字,最多 5,000 点;逐句模式每个词或每 2 个中日韩文字 1 点,整篇模式减半。Corpus.Ink:每次查询 20 点,每次最多 10 句,最多翻到第 500 句,每个密钥每分钟最多 60 次。只扣点数包的点数。
语法纠错:每次最多 5,000 词,每个词 1 点,只算送去检查的英文。