{"uid":"cap_6UE3gGt8rzVLmrUnyBcTU","slug":"agent402-tools-text-chunker-eb694dfe","name":"agent402.tools Text Chunker","description":"Split text into overlapping chunks for RAG ingestion - by characters (default) or by exact LLM tokens. Returns the chunks plus offsets. Deterministic, no model needed.","url":"https://agent402.tools/api/text-chunk","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"size":{"type":"number","description":"chunk size (default 800)"},"text":{"type":"string","description":"Text to split into chunks (max 500KB)"},"unit":{"type":"string","description":"chars (default) | tokens"},"model":{"type":"string","description":"tokenizer model when unit=tokens (default gpt-4o)"},"overlap":{"type":"number","description":"overlap between chunks (default 0)"}}},"responseSchema":{"type":"json","example":{"size":120,"unit":"chars","count":4,"chunks":["The x402 protocol lets an agent pay for a single request. A server answers with payment terms, the agent signs a stablec","gent signs a stablecoin authorization, and the request is retried with the payment attached. Payment settles on chain, s"],"overlap":20}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","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.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_PnEfoi5H3O5q46WAwZf4m","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Splits input text into overlapping chunks by character count or LLM token count for RAG ingestion, returning chunks with their offsets.","exampleAgentPrompt":"Chunk this 10,000-word article into overlapping segments of 800 tokens each (using the gpt-4o tokenizer) with a 100-token overlap so I can load them into my vector database.","exampleUseCases":null,"resultDescription":"An array of text chunks derived from the input, each with its content and character/token offsets indicating its position in the original text. Output is deterministic given the same inputs.","failureModes":["Text field missing or empty — API returns 400 error","Invalid unit value (not 'chars' or 'tokens') — API returns 400 error","Invalid or unsupported tokenizer model name — API returns 400/422 error","chunk size or overlap value is non-positive or overlap exceeds chunk size — may return 400 error or degenerate chunks","Payment not attached or insufficient — API returns 402 Payment Required"],"whenToPreferThis":"Use this endpoint when you need deterministic, model-free text splitting for RAG or embedding pipelines, especially when you require precise token-level chunking using a specific LLM tokenizer (e.g. gpt-4o) or need overlapping windows for better retrieval recall. Prefer over ad-hoc string splitting when token accuracy matters.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T06:47:49.253Z","isFirstParty":false}