{"uid":"cap_7lWPVKI82ZBla0MbpTXbF","slug":"alpha-stream-agentdiet-dev-bm25-budget-controlled-web-distillation-d1e5137e","name":"BM25 Budget-Controlled Web Distillation (Context Bloat Eliminator)","description":"Distill a URL or raw HTML payload with BM25 budget control (Live x402 v2, IETF MPP & MCP endpoint at https://alpha-stream.agentdiet.dev/v1/context-bloat-eliminator)","url":"https://alpha-stream.agentdiet.dev/v1/context-bloat-eliminator?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","minLength":1,"description":"Target webpage URL to fetch and distill (or builtin://stripe-docs)"},"html":{"type":"string","description":"Optional raw HTML string to distill directly without fetching"},"mode":{"enum":["markdown","structured","skeleton","budget"],"type":"string","default":"markdown","description":"Distillation mode"},"query":{"type":"string","description":"BM25 focus query when mode=budget"},"max_tokens":{"type":"integer","minimum":20,"description":"Strict token budget ceiling when mode=budget"}}},"responseSchema":{"type":"object","required":["status","roi_proof","data"],"properties":{"data":{"type":"object","description":"Distilled Markdown, structured JSON tables/metadata, skeleton outline, or BM25 budget excerpt."},"cache":{"type":"object","properties":{"status":{"enum":["HIT","MISS"],"type":"string"},"cache_key":{"type":"string"},"latency_ms":{"type":"number"}}},"status":{"type":"string","description":"Execution status ('ok')"},"billing":{"type":"object","properties":{"agent_id":{"type":"string"},"payment_method":{"type":"string"},"fee_charged_usd":{"type":"number"}}},"roi_proof":{"type":"object","properties":{"raw_tokens":{"type":"integer"},"tokens_saved":{"type":"integer"},"roi_multiplier":{"type":"number"},"distilled_tokens":{"type":"integer"},"llm_cost_saved_usd":{"type":"number"},"compression_ratio_pct":{"type":"number"}}}}},"example":null,"exampleRequest":null,"tags":[],"displayCostAmount":"0.001","displayCostAsset":"USD","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":"mpp","network":"tempo","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"mpp","network":"tempo","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_hRdLtFJhcif5ynOeYeUdv","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"alpha-stream.agentdiet.dev","brandSlug":"alpha-stream-agentdiet-dev-mpp","brandBaseUrl":"https://alpha-stream.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Fetches and distills a URL or raw HTML into compact agent-ready tokens using BM25 relevance scoring with a strict token budget ceiling","exampleAgentPrompt":"Distill https://stripe.com/docs/payments/checkout into compact markdown using budget mode, focused on the query 'payment session creation', and cap the output at 500 tokens so I can fit it into my prompt without bloat.","exampleUseCases":[{"title":"Distill docs into agent prompt context","prompt":"Grab the Stripe Checkout docs at https://stripe.com/docs/payments/checkout and distill them into structured markdown, keeping only content relevant to 'subscription billing', capped at 800 tokens — I need it small enough to fit in my agent's context window."},{"title":"Extract key content from competitor landing page","prompt":"Fetch https://openai.com/pricing and distill it into a skeleton outline so I can quickly see the structure and pricing tiers without reading the whole page."},{"title":"Reduce raw HTML before LLM analysis","prompt":"I have this big raw HTML blob from a news article — distill it into clean markdown using budget mode with the query 'climate policy' and a max of 400 tokens so I can analyze it cheaply without burning through my LLM budget."}],"resultDescription":"Returns a 'data' object containing the distilled content in the requested format (Markdown, structured JSON tables/metadata, skeleton outline, or BM25-ranked budget excerpt), alongside an 'roi_proof' object showing raw token count, distilled token count, tokens saved, compression ratio percentage, estimated LLM cost saved in USD, and an ROI multiplier. Also includes optional cache hit/miss status and billing info.","failureModes":["URL is unreachable or returns non-200 HTTP status — endpoint may return an error status","HTML payload is empty or malformed — distillation may return minimal or empty output","max_tokens set below minimum of 20 — rejected by schema validation","mode=budget used without providing a query — BM25 scoring has no focus term","Target page behind authentication or bot protection — fetch may fail silently","Token budget too tight relative to page content — output may be truncated aggressively"],"whenToPreferThis":"Choose this endpoint when you need to reduce context bloat from web pages or raw HTML before passing content to an LLM, especially when you have a strict token budget. It is uniquely suited for BM25-ranked relevance filtering — use it when you want only the most query-relevant passages from a page rather than a naive truncation. Prefer it over generic scrapers when LLM cost savings and compression ratio reporting matter to your workflow.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-21T06:40:18.727Z","isFirstParty":false,"canonicalSlug":"alpha-stream-agentdiet-dev-bm25-budget-controlled-web-distillation-d1e5137e"}