API
extract_text_toc
Extract a TOC tree from text and return JSON.
Member API
Use SUPTOC as a deterministic auxiliary tool for LLM products. API access requires membership; each 1,000 CNY membership level grants 100,000 API calls.
curl -X POST https://api.suptoc.com/v1/toc/validate-and-correct \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "Chapter 1 Overview\n1.1 Product\nChapter 3 API",
"tasks": ["extract", "detect", "validate", "correct"]
}'One API can extract structure, detect style, validate issues, and correct TOC problems.
Extract a TOC tree from text and return JSON.
Detect current TOC style and mixed rules.
Validate skipped numbering, missing levels, duplicates, and discontinuity.
Correct numbering and hierarchy by language rules.
Suitable as a synchronous tool in LLM calling chains.
Does not invent headings absent from source text.
textTOC text to process, requiredtasksextract / detect / validate / correct, multiple allowedlanguageauto / zh / enstrictenable strict no-hallucination constraintsreturn_formatjson / markdown / csv{
"status": "completed",
"elapsed_ms": 11,
"style": "numeric numbered TOC",
"hallucination_policy": "source_bound_only",
"issues": [
{
"type": "missing_chapter",
"line": 3,
"message": "Chapter number jumps from 1 to 3"
}
],
"corrected_text": "Chapter 1 Overview\n1.1 Product\nChapter 2 API",
"toc": [
{ "title": "Chapter 1 Overview", "level": 1, "children": [] }
]
}API access requires membership. Each upgrade level costs 1,000 CNY and grants 100,000 API calls. Upgrade again for more quota.