LLM HTML-to-Markdown Cleaner API
Convert noisy web pages or raw HTML into clean, token-efficient Markdown for RAG.
Split Markdown into token-budgeted RAG chunks with heading breadcrumbs and intact code/tables. Split Markdown and technical docs into token-budgeted RAG chunks while keeping fenced code blocks and tables intact, injecting heading breadcrumbs, and generating deterministic chunk IDs.
{
"ok": true,
"data": {
"chunk_count": 2,
"total_chars": 188,
"total_estimated_tokens": 68,
"avg_chunk_tokens": 34,
"preserved_code_blocks": 1,
"preserved_tables": 1,
"chunks": [
{
"index": 0,
"chunk_id": "chk_2296f0a18a703ee7",
"text": "[Context: Gateway Manual > Authentication]\n\n# Gateway Manual\n\n## Authentication\n\nPass your proxy secret header.\n\n```bash\ncurl -X POST https://api.tinplate.dev/v1/json-heal\n```",
"raw_text": "# Gateway Manual\n\n## Authentication\n\nPass your proxy secret header.\n\n```bash\ncurl -X POST https://api.tinplate.dev/v1/json-heal\n```",
"heading_path": [
"Gateway Manual",
"Authentication"
],
"block_types": [
"heading",
"prose",
"code"
],
"char_count": 175,
"estimated_tokens": 44,
"start_line": 1,
"end_line": 8
},
{
"index": 1,
"chunk_id": "chk_664daeea150dbc83",
"text": "[Context: Gateway Manual > Quotas]\n\n## Quotas\n\n| Plan | Calls |\n| --- | --- |\n| Basic | 500 |",
"raw_text": "## Quotas\n\n| Plan | Calls |\n| --- | --- |\n| Basic | 500 |",
"heading_path": [
"Gateway Manual",
"Quotas"
],
"block_types": [
"heading",
"table"
],
"char_count": 93,
"estimated_tokens": 24,
"start_line": 10,
"end_line": 13
}
]
},
"meta": {
"request_id": "req_chk_01",
"ms": 1
}
}
curl -X POST "https://api.tinplate.dev/v1/rag-chunker" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TINPLATE_KEY" \
-d '{"text":"# Gateway Manual\n\n## Authentication\nPass your proxy secret header.\n\n```bash\ncurl -X POST https://api.tinplate.dev/v1/json-heal\n```\n\n## Quotas\n| Plan | Calls |\n| --- | --- |\n| Basic | 500 |","max_tokens":128,"overlap_tokens":16,"prepend_breadcrumbs":true}'import { TinplateClient } from "@tinplate/sdk";
const tinplate = new TinplateClient({
apiKey: process.env.TINPLATE_API_KEY!,
});
const { data, meta } = await tinplate.call("/v1/rag-chunker", {
"text": "# Gateway Manual\n\n## Authentication\nPass your proxy secret header.\n\n```bash\ncurl -X POST https://api.tinplate.dev/v1/json-heal\n```\n\n## Quotas\n| Plan | Calls |\n| --- | --- |\n| Basic | 500 |",
"max_tokens": 128,
"overlap_tokens": 16,
"prepend_breadcrumbs": true
});
console.log(`[${meta.ms} ms]`, data);import requests
response = requests.post(
"https://api.tinplate.dev/v1/rag-chunker",
headers={
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_TINPLATE_KEY",
},
json={
"text": "# Gateway Manual\n\n## Authentication\nPass your proxy secret header.\n\n```bash\ncurl -X POST https://api.tinplate.dev/v1/json-heal\n```\n\n## Quotas\n| Plan | Calls |\n| --- | --- |\n| Basic | 500 |",
"max_tokens": 128,
"overlap_tokens": 16,
"prepend_breadcrumbs": true
}
)
print(response.json())const response = await fetch("https://api.tinplate.dev/v1/rag-chunker", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_TINPLATE_KEY",
},
body: JSON.stringify({
"text": "# Gateway Manual\n\n## Authentication\nPass your proxy secret header.\n\n```bash\ncurl -X POST https://api.tinplate.dev/v1/json-heal\n```\n\n## Quotas\n| Plan | Calls |\n| --- | --- |\n| Basic | 500 |",
"max_tokens": 128,
"overlap_tokens": 16,
"prepend_breadcrumbs": true
}),
});
const result = await response.json();
console.log(result);{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "tinplate_rag_chunker",
"arguments": {
"text": "# Gateway Manual\n\n## Authentication\nPass your proxy secret header.\n\n```bash\ncurl -X POST https://api.tinplate.dev/v1/json-heal\n```\n\n## Quotas\n| Plan | Calls |\n| --- | --- |\n| Basic | 500 |",
"max_tokens": 128,
"overlap_tokens": 16,
"prepend_breadcrumbs": true
}
}
}POST /v1/rag-chunker)| Parameter | Type & Constraints | Description |
|---|---|---|
text required |
stringminLen: 1, maxLen: 200000 |
Raw Markdown, technical documentation, or prose document to split into semantic RAG chunks. |
max_tokens optional |
integermin: 32, max: 8192, default: 256 |
Target maximum token budget per chunk (default: 256). |
overlap_tokens optional |
integermin: 0, max: 1024, default: 24 |
Approximate trailing token overlap carried into the next chunk within the same section (default: 24). |
prepend_breadcrumbs optional |
booleandefault: true |
Prepend the active Markdown heading breadcrumb path (e.g. '[Context: Guide > Auth]') to each chunk's 'text' field for embedding context. |
split_on_heading_level optional |
integermin: 1, max: 6, default: 2 |
Always start a new chunk when encountering a heading at or above this level (1 = H1, 2 = H1/H2). |
data Object Fields (200 OK)| Field | Type | Description |
|---|---|---|
chunk_count |
integer |
Field 'chunk_count' |
total_chars |
integer |
Field 'total_chars' |
total_estimated_tokens |
integer |
Field 'total_estimated_tokens' |
avg_chunk_tokens |
number |
Field 'avg_chunk_tokens' |
preserved_code_blocks |
integer |
Field 'preserved_code_blocks' |
preserved_tables |
integer |
Field 'preserved_tables' |
chunks |
object[] |
Field 'chunks' |
Release: v1.0.39 ·
Verified: 16 November 2026 ·
Portfolio Median: 0.318 ms in-Worker V8 compute (add 15–65 ms HTTPS RTT) ·
See Full Portfolio Benchmarks →
Direct Polar All-Access Keys unlock all 42 APIs (49 endpoints), /v1/pipeline, and /mcp on api.tinplate.dev:
Pro ($29/mo · 120 req/min · 100k/mo · 128 KB) or Team ($79/mo · 300 req/min · 500k/mo · 256 KB).
| Plan | Monthly Price | Included Requests | Rate Limit | Max Payload | Best For |
|---|---|---|---|---|---|
| BASIC | $0.00 / mo | 500 / month | 10 req / min | 64 KB | Evaluation & CI smoke tests |
| PRO | $9.99 / mo | 15,000 / month | 60 req / min | 128 KB | Solo devs & production apps |
| ULTRA | $29.99 / mo | 100,000 / month | 300 req / min | 256 KB | Growing SaaS & multi-agent pipelines |
| MEGA | $79.99 / mo | 500,000 / month | 1,000 req / min | 256 KB | High-volume enterprise workloads |
Use 04-html-to-markdown to clean raw web pages into Markdown, 35-rag-chunker to split that Markdown into context-enriched vector chunks, and 14-hallucination-diff to verify LLM answers against the retrieved chunks.
A chunk that only says 'Rate limit is 60 req/min' loses what product or tier it belongs to. Prepending '[Context: Gateway Manual > Pricing > PRO Tier]' dramatically improves retrieval precision.
Yes, chunk_id is a deterministic hash of the chunk index and normalized text, making vector DB re-indexing idempotent.
Documents are chunked in memory with zero payload logging or storage.
Worker Zero-Logging Guarantee: Cloudflare Workers Observability and invocation logging are disabled (observability.enabled = false, head_sampling_rate = 0, invocation_logs = false). Requests via RapidAPI or Zyla traverse marketplace proxies; use a Direct Bearer Key for zero-intermediary routing.
Convert noisy web pages or raw HTML into clean, token-efficient Markdown for RAG.
Estimate tokens, optimize message order for prompt caching, and calculate LLM API costs.
Fast first filter to catch unsupported numbers, dates, and names in LLM answers vs RAG sources.