跳至正文
TurnitPass
开发者API v1获取 API 密钥
浏览文档

开发者API 参考

TurnitPass REST API

端点、参数、限制与错误码。

POST/api/v1/humanize

降低文本中的 AI 写作信号。模式:reduce-aigc、reduce-both、paraphrase、academic-polish。

参数类型默认值说明
text必填string—待改写的文本。至少 3 个词单位,每次请求最多 500 质量单位。
languagestringen语言代码,如 en 或 zh。
modeenumreduce-aigcreduce-aigc, reduce-both, paraphrase, academic-polish
personal_termsstring[]—最多 30 个需保持不变的名称或术语,每个最长 120 字符。
请求
POST /api/v1/humanize
{ "text": "粘贴需要修改的草稿。", "language": "zh", "mode": "reduce-aigc" }
响应
200 OK
{
  "output": "…",
  "words_used": 142,
  "words_remaining": 2858,
  "usage": { "words": 142, "characters": 861 },
  "metrics": { "kind": "heuristic_estimate", "aiLikeScore": 18, "naturalTone": 82, "sentenceVariety": 74, "readability": 68 }
}
POST/api/v1/paraphrase

以 standard、fluency、formal、academic、simple、creative、expand 或 shorten 模式改写文本。synonyms_level 取值 0 到 100。

参数类型默认值说明
text必填string—待改写的文本。每次请求最多 2,000 质量单位。
languagestringen语言代码,如 en 或 zh。
modeenumstandardstandard, fluency, formal, academic, simple, creative, expand, shorten
synonyms_levelinteger50词语替换的幅度,范围 0 到 100。
请求
POST /api/v1/paraphrase
{ "text": "粘贴需要修改的草稿。", "language": "zh", "mode": "academic", "synonyms_level": 60 }
响应
200 OK
{
  "output": "…",
  "words_used": 142,
  "words_remaining": 2858,
  "usage": { "words": 142, "characters": 861 }
}
POST/api/v1/rewrite

学术润色,优化结构、语气和句子衔接。

参数类型默认值说明
text必填string—待改写的文本。至少 3 个词单位,每次请求最多 500 质量单位。
languagestringen语言代码,如 en 或 zh。
请求
POST /api/v1/rewrite
{ "text": "粘贴需要修改的草稿。", "language": "zh" }
响应
200 OK
{
  "output": "…",
  "words_used": 142,
  "words_remaining": 2858,
  "usage": { "words": 142, "characters": 861 }
}
POST/api/v1/detect

为粘贴的文本或提取的文档返回 AI 分数、写作信号和修改建议。source_kind:paste、pdf、docx 或 txt。

参数类型默认值说明
text必填string—待检测的文本。最多 5,000 词或 30,000 字符。
languagestringen语言代码,如 en 或 zh。
source_kindenumpastepaste, pdf, docx, txt
original_filenamestring—原始文件名,最长 255 字符。
请求
POST /api/v1/detect
{ "text": "粘贴需要修改的草稿。", "language": "zh", "source_kind": "paste" }
响应
200 OK
{
  "score": 62,
  "label": "…",
  "risk_level": "high",
  "signals": [{ "key": "…", "label": "…", "value": 0.7, "level": "medium", "detail": "…" }],
  "passages": [{ "text": "…", "label": "ai", "level": "high" }],
  "detection_quota": { "limit": 10, "remaining": 9, "resets_at": "2026-10-25T00:00:00Z" }
}
POST/api/v1/citation

将 DOI、URL 或手动录入的引用格式化为 22 种格式,包括 APA、MLA、Chicago、IEEE、Harvard、Nature、Vancouver、ACS、AMA、GB/T 7714、OSCOLA 和 Bluebook。响应包含 html、text、BibTeX 和 RIS。

参数类型默认值说明
inputstring—DOI、URL 或文献标题,最长 2,000 字符。与 citation 二选一。
citationobject—包含标题、作者和来源信息的引用对象。与 input 二选一。
stylestringapa引用格式标识,如 apa、mla 或 chicago。
请求
POST /api/v1/citation
{ "input": "10.1038/nature14539", "style": "apa" }
响应
200 OK
{
  "citation": { "title": "…", "authors": [{ "firstName": "…", "lastName": "…" }] },
  "style": "apa",
  "html": "…",
  "text": "…",
  "bibtex": "…",
  "ris": "…"
}
POST/api/v1/bibliography

按指定格式排序并格式化引用列表,输出 html 和 text,并支持导出 BibTeX 和 RIS。

参数类型默认值说明
citations必填object[]—1 到 100 个引用对象,每个包含 id 和 title。
stylestringapa引用格式标识,如 apa、mla 或 chicago。
请求
POST /api/v1/bibliography
{ "citations": [{ "id": "1", "title": "…", "authors": [] }], "style": "apa" }
响应
200 OK
{
  "style": "apa",
  "entries": [{ "citation": { "id": "1" }, "html": "…", "text": "…" }],
  "html": "…",
  "text": "…",
  "bibtex": "…",
  "ris": "…"
}
GET/api/v1/status

返回密钥名称、剩余字数、单次请求限制、检测次数和速率限制。

此端点无需参数。

响应
200 OK
{
  "name": "Production",
  "words_remaining": 2858,
  "max_humanize_quality_units": 500,
  "max_paraphrase_quality_units": 2000,
  "max_detection_words_per_request": 5000,
  "max_detection_characters": 30000,
  "detection_quota": { "limit": 10, "remaining": 9, "resets_at": "2026-10-25T00:00:00Z" },
  "rate_limit_per_minute": 50
}

参数与选项

认证
Authorization: Bearer tp_live_your_api_key
拟人改写术语
可选的 personal_terms 数组(最多 30 个),在英文拟人改写中保持人名、专业术语和品牌拼写不变。

速率限制与请求限制

拟人改写和学术改写
每次请求 500 个单位1 个汉字计 1 个单位,3 个其他字符计 1 个单位,不足 1 个单位按 1 个计。所有套餐限制相同。
改写润色
每次请求 2,000 个单位计算方式相同。
AI 检测
每次 5,000 字或 30,000 个字符计入每日检测次数。更长的文档请拆分。
速率限制
每个密钥每分钟 50 次请求引用和参考文献为 100 次,且不扣字数。
API 密钥
最多 5 个有效密钥

错误处理

错误以 JSON 返回,包含 error、code 和 message 字段。

400
invalid_input, quality_limit_exceeded, word_limit_exceeded
401
missing_api_key, invalid_api_key
403
insufficient_words, daily_detection_limit
429
rate_limited
500
internal_error
响应
400
{
  "error": "quality_limit_exceeded",
  "code": "quality_limit_exceeded",
  "message": "Up to 500 Chinese or 1,500 English characters per request."
}
对 429 和 5xx 使用退避重试。4xx 需先修正请求再重试。

示例

拟人改写
JSON
POST /api/v1/humanize
{
  "text": "粘贴需要修改的草稿。",
  "language": "zh",
  "mode": "reduce-aigc",
  "personal_terms": ["TurnitPass"]
}

200 OK
{
  "output": "…",
  "words_used": 142,
  "words_remaining": 2858,
  "usage": { "words": 142, "characters": 861 },
  "metrics": { "kind": "heuristic_estimate", "aiLikeScore": 18, "naturalTone": 82, "sentenceVariety": 74, "readability": 68 }
}
改写润色、AI 检测和引用
JSON
POST /api/v1/paraphrase
{
  "text": "粘贴需要修改的草稿。",
  "language": "zh",
  "mode": "academic",
  "synonyms_level": 60
}

POST /api/v1/detect
{
  "text": "粘贴需要修改的草稿。",
  "language": "zh",
  "source_kind": "paste"
}

POST /api/v1/citation
{
  "input": "https://example.com/article",
  "style": "apa"
}

下一步