{"uid":"cap__hmotYM17IsUc8MEDZNii","slug":"writerslogic-chunk-boundary-planner-c11ef1f4","name":"WritersLogic Chunk Boundary Planner","description":"Pay-per-call agents settled in USDC on Base via x402. Every response carries a signed provenance envelope.","url":"https://agents.writerslogic.com/api/v1/chunk-boundaries?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"text":{"type":"string","maxLength":100000,"minLength":1,"description":"Text to chunk (Markdown, plain text or HTML tables)."},"maxTokens":{"type":"integer","maximum":1000000,"minimum":32,"description":"Hard cap per chunk."},"tokenizer":{"type":"string","maxLength":64,"minLength":1,"description":"o200k_base or cl100k_base. Any other name (including Claude models) returns status unsupported for items that need counting; caller token counts are always accepted."},"includeText":{"type":"boolean","description":"Also return each chunk's text. Default false (slice by span)."}}},"responseSchema":{"type":"json"},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_M8RtY0h7FsdaVSLJdx_8c","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Plans semantically-aware chunk boundaries for splitting long text into token-capped pieces suitable for feeding to an LLM, with verified token counts and multi-encoding span offsets.","exampleAgentPrompt":"Split this 50,000-character markdown article into chunks of at most 4096 tokens using the o200k_base tokenizer, keeping sentence and heading boundaries intact, and give me the UTF-8 offsets for each chunk.","exampleUseCases":[{"title":"RAG pipeline document ingestion","prompt":"I need to chunk this 80,000-character technical manual into pieces of at most 512 tokens using cl100k_base so I can embed each chunk — make sure no sentence or code block gets cut in half and give me the byte offsets."},{"title":"LLM context window batching","prompt":"Take this long markdown report and plan how to feed it to GPT-4 in 8192-token chunks using o200k_base; I need the chunk boundaries to fall only between paragraphs or sentences, never mid-table or mid-code-fence."},{"title":"Verifying oversized sentence detection","prompt":"Split this legal document into 2048-token chunks with the cl100k_base tokenizer, and flag any individual sentences or tables that are too long to fit in a single chunk so I know which ones need manual attention."}],"resultDescription":"Returns an array of chunk spans, each with offsets in UTF-16 code units, Unicode code points, UTF-8 bytes, and grapheme clusters, along with verified token counts and an exceedsCap flag. The overall status is 'ok' if all chunks fit within maxTokens, or 'fail' if any single indivisible unit (sentence, table, code fence) exceeded the cap. Chunks tile the input exactly with no gaps or overlaps.","failureModes":["Unsupported tokenizer name (including Claude model names) returns status 'unsupported' for items requiring counting","A single sentence, table, or code fence longer than maxTokens is returned alone with exceedsCap=true and status 'fail' — it is never cut","Text exceeding 100,000 characters is rejected","maxTokens below 32 or above 1,000,000 is rejected","Sentence boundary detection may be incorrect after abbreviations due to ICU rule limitations"],"whenToPreferThis":"Choose this endpoint when you need semantically correct, token-verified chunk boundaries that respect sentence integrity, Markdown structure (headings, tables, code fences), and HTML tables. It is preferable to naive character- or token-splitting when you need guarantees that chunks tile the input exactly, boundaries never fall mid-sentence or mid-structure, and you need precise multi-encoding offsets (UTF-16, code points, UTF-8, graphemes) for downstream processing. Supports o200k_base (GPT-4o) and cl100k_base (GPT-4/GPT-3.5) tokenizers with verified counts.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-19T06:39:01.832Z","isFirstParty":false,"canonicalSlug":"writerslogic-chunk-boundary-planner-c11ef1f4"}