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 點,只算送去檢查的英文。