Member API

Member API for millisecond TOC processing

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"]
  }'

API capabilities

One API can extract structure, detect style, validate issues, and correct TOC problems.

API

extract_text_toc

Extract a TOC tree from text and return JSON.

API

detect_style_toc

Detect current TOC style and mixed rules.

API

validate_toc

Validate skipped numbering, missing levels, duplicates, and discontinuity.

API

correct_toc

Correct numbering and hierarchy by language rules.

API

Millisecond latency

Suitable as a synchronous tool in LLM calling chains.

API

No-hallucination boundary

Does not invent headings absent from source text.

Request body

textTOC text to process, required
tasksextract / detect / validate / correct, multiple allowed
languageauto / zh / en
strictenable strict no-hallucination constraints
return_formatjson / markdown / csv

Response example

{
  "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": [] }
  ]
}

Membership rule

API access requires membership. Each upgrade level costs 1,000 CNY and grants 100,000 API calls. Upgrade again for more quota.