Split text/Markdown into RAG-ready chunks: token-based sizing, heading-aware boundaries, overlap at sentence level, heading path and page metadata per chunk.
| Name | Type | Description |
|---|---|---|
text | string · optional | Text or Markdown (or upload a file). |
maxTokens | integer · optional | Chunk size in tokens, 50–8000, default 512. |
overlap | integer · optional | Overlap tokens carried into the next chunk, default 0. |
splitOn | string · optional | heading (default) or paragraph. |
curl -X POST https://api.bigapi.dev/v1/text/chunk -H 'Authorization: Bearer $KEY' -H 'Content-Type: application/json' -d '{"text":"# Doc...","maxTokens":512,"overlap":50}'
{
"chunks": [
{ "text": "The term is twelve months...", "tokens": 118,
"page": 1, "heading_path": ["Contract", "Term"] }
],
"chunk_count": 6, "total_tokens": 640,
"_meta": { "op": "text.chunk", "durationMs": 14.2 }
}