Tinplate 42 Edge APIs

Developer Utilities Tier 2 Ready POST /v1/rag-chunker

Smart RAG Document Chunker API — Split Markdown by Token Budget Without Breaking Code or Tables

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.

Try It Live in Your Browser · No API Key Required

1. Interactive Sandbox & Sample JSON Output

200 OK · Ready

Editable Request JSON (POST /v1/rag-chunker)

Live 200 OK Response Envelope

{
  "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
  }
}

2. Quickstart Code Examples

Full TypeScript & Python SDK →
curl -X POST "https://api.tinplate.dev/v1/rag-chunker" \
  -H "Content-Type: application/json" \
  -H "X-RapidAPI-Key: YOUR_RAPIDAPI_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"; // npm install @tinplate/sdk

const tinplate = new TinplateClient({
  rapidApiKey: process.env.RAPIDAPI_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",
        "X-RapidAPI-Key": "YOUR_RAPIDAPI_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",
    "X-RapidAPI-Key": "YOUR_RAPIDAPI_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
    }
  }
}
OpenAPI 3.0.3 Schema Contract

Request Parameters & Response Schema Reference

Request Body Parameters (POST /v1/rag-chunker)

Parameter Type & Constraints Description
textrequired string
minLen: 1, maxLen: 200000
Raw Markdown, technical documentation, or prose document to split into semantic RAG chunks.
max_tokensoptional integer
min: 32, max: 8192, default: 256
Target maximum token budget per chunk (default: 256).
overlap_tokensoptional integer
min: 0, max: 1024, default: 24
Approximate trailing token overlap carried into the next chunk within the same section (default: 24).
prepend_breadcrumbsoptional boolean
default: 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_leveloptional integer
min: 1, max: 6, default: 2
Always start a new chunk when encountering a heading at or above this level (1 = H1, 2 = H1/H2).

Response 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'

3. What Markdown & Code Aware Smart RAG Document Chunker API Detects & Validates

Honest Engineering Boundaries

4. Known Limitations & Test Verification

Release Version: v1.0.7 · Last Verified / Benchmarked: 14 November 2026 · Latency Note: Sub-millisecond figures measure in-Worker V8 compute time (typical client HTTPS network RTT to the nearest Cloudflare PoP is 15–65 ms) · See Full Portfolio Benchmarks & Corpora →

5. Marketplace Plans & Payload Quotas

Plan Monthly Price Included Requests Rate Limit Max Request Payload Best For
BASIC $0.00 / month 500 / month (hard limit) 10 req / min 64 KB Evaluation, local development & CI smoke tests
PRO $9.99 / month 15,000 / month 60 req / min 128 KB Solo developers & production apps
ULTRA $29.99 / month 100,000 / month 300 req / min 256 KB Growing SaaS & multi-agent pipelines
MEGA $79.99 / month 500,000 / month 1,000 req / min 256 KB High-volume enterprise workloads

6. Frequently Asked Questions

How does this pair with 04-html-to-markdown and 14-hallucination-diff?

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.

Why prepend heading breadcrumbs to each chunk?

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.

Are chunk_id values deterministic across runs?

Yes, chunk_id is a deterministic hash of the chunk index and normalized text, making vector DB re-indexing idempotent.

Zero Payload Logging

7. Data Handling, Privacy & Marketplace Proxy Disclosure

Documents are chunked in memory with zero payload logging or storage.

Worker Zero-Logging Guarantee: Cloudflare Workers Observability and invocation logging are disabled in configuration (observability.enabled = false, head_sampling_rate = 0, invocation_logs = false). Payloads are processed strictly in volatile V8 memory and never logged or stored by Tinplate.

Marketplace Proxies vs. Direct Bearer Key: Requests sent via RapidAPI or Zyla API Hub pass through those marketplaces' proxy infrastructure (subject to their respective privacy policies). Security-sensitive workloads requiring end-to-end zero-intermediary processing can connect directly to https://api.tinplate.dev using a Direct Bearer Key (Authorization: Bearer <API_KEY>). Read our full Privacy Notice and OpenAPI 3.0.3 JSON Schema.

Related Tinplate APIs

📄 POST /v1/html-to-markdown Tier 1

LLM HTML-to-Markdown Cleaner API

Convert noisy web pages or raw HTML into clean, token-efficient Markdown for RAG.

🧮 POST /v1/prompt-cache-budgeter AI Safety & Agents

Prompt Cache Key & Context Budgeter API

Estimate tokens, optimize message order for prompt caching, and calculate LLM API costs.

⚖️ POST /v1/hallucination-diff AI Safety & Agents

Deterministic Hallucination Diff API

Fast first filter to catch unsupported numbers, dates, and names in LLM answers vs RAG sources.