{"uid":"cap_AvDWh2mh8ozFmrwlkHsID","slug":"halowerk-context-planner-c5cd093d","name":"Halowerk Context Planner","description":"Plans the division of a long input for a given model. It reserves room for the system prompt, the expected answer and a safety margin, then works out how many chunks are needed and where to cut, preferring paragraph boundaries over line and sentence boundaries and never cutting inside a word. Optional overlap carries context across the seams.","url":"https://modell.halowerk.com/v1/context-plan","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"text":{"type":"string","maxLength":2000000,"minLength":1,"description":"The document to split."},"model":{"type":"string","description":"Target model id, e.g. claude-opus-5."},"boundary":{"enum":["absatz","zeile","satz","auto"],"type":"string","default":"auto","description":"Where to cut. auto tries paragraph, then line, then sentence."},"safety_margin":{"type":"number","default":0.1,"maximum":0.5,"minimum":0,"description":"Fraction of the window held back against estimation error. 0.1 = 10 percent."},"overlap_tokens":{"type":"integer","default":0,"maximum":20000,"minimum":0,"description":"Tokens of the previous chunk repeated at the start of the next."},"system_prompt_tokens":{"type":"integer","default":500,"minimum":0,"description":"Room to reserve for the system prompt per chunk."},"expected_output_tokens":{"type":"integer","default":2000,"minimum":0,"description":"Room to reserve for the answer per chunk."}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","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.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_owbN22vnAIxqUI-P9XtJ5","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Plans how to split a long text into chunks that fit a language model's context window, accounting for system prompt, expected answer, and a safety margin, with optional overlap between chunks.","exampleAgentPrompt":"I have a 50,000-word research report I need to process with GPT-4o — can you plan how to chunk it so each piece fits the context window, reserving 1,000 tokens for the system prompt and 2,000 tokens for the answer, with 200 tokens of overlap between chunks and cuts at paragraph boundaries?","exampleUseCases":[{"title":"Chunking a legal document for LLM review","prompt":"I have a 120-page legal contract I need to analyze with Claude 3.5 Sonnet. Can you plan the chunking so each piece fits the model's context window, with 800 tokens reserved for the system prompt, 1,500 tokens for the expected answer, and 150 tokens of overlap so no context is lost at the seams?"},{"title":"Preprocessing a long transcript for summarization","prompt":"I've got a 3-hour meeting transcript I want to summarize using GPT-4o-mini — can you work out how to split it into chunks that fit the model, cutting at paragraph breaks where possible, and leaving 500 tokens for the system prompt and 1,000 tokens for each summary response?"},{"title":"Planning batch ingestion of a book into a RAG pipeline","prompt":"Before I ingest this entire novel into my RAG system using text-embedding-3-large, I need a chunk plan — split it at paragraph boundaries, never mid-word, with 100-token overlaps between chunks and a 200-token safety margin. How many chunks will I get and where are the cut points?"}],"resultDescription":"Returns a structured chunk plan specifying the total number of chunks, the start and end positions (character or token offsets) for each chunk, and any overlap regions — with cuts preferring paragraph, then line, then sentence boundaries, and never splitting inside a word.","failureModes":["Input text exceeds model's maximum context even in a single chunk after reservations — returns an error indicating the text is too large","Unknown or unsupported model name — returns an error as token limits cannot be determined","Invalid parameter values (e.g. negative overlap or margins larger than context window) — returns a validation error","Empty input text — may return a single empty chunk or an error depending on implementation"],"whenToPreferThis":"Use this endpoint when you need to programmatically plan how to split long documents for LLM processing before actually calling the model — especially when you want paragraph-aware boundaries, controlled overlap, and accurate token budget reservations for system prompts and expected answers. Prefer this over ad-hoc splitting when token precision and boundary quality matter, such as in RAG pipelines, document summarization workflows, or any agentic loop that feeds long context to a model.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T06:33:46.707Z","isFirstParty":false}