{"uid":"cap_-iq5ryCDtBaVD0V5KNR6W","slug":"mesh-agentdiet-dev-web-content-distiller-with-bm25-budget-control-4ab6c284","name":"Web Content Distiller with BM25 Budget Control","description":"Distill a URL or raw HTML payload with BM25 budget control (Live x402 v2, IETF MPP & MCP endpoint at https://mesh.agentdiet.dev/v1/rag-chunk)","url":"https://mesh.agentdiet.dev/v1/rag-chunk?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_tMMi1z70wa44q0bHRJ8JB","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"mesh.agentdiet.dev","brandSlug":"mesh-agentdiet-dev-mpp","brandBaseUrl":"https://mesh.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Fetches and distills a URL or raw HTML into clean Markdown, structured JSON, a skeleton outline, or a BM25-ranked token-budgeted excerpt focused on a specific query","exampleAgentPrompt":"Distill the content at https://docs.stripe.com/payments/accept-a-payment into clean markdown using budget mode, focused on 'payment intent setup', and keep it under 500 tokens.","exampleUseCases":[{"title":"RAG pipeline web content ingestion","prompt":"Fetch and distill https://www.sec.gov/cgi-bin/browse-edgar?action=getcompany&CIK=AAPL into structured JSON so I can ingest the tables into my RAG pipeline."},{"title":"Token-budgeted competitor research","prompt":"Pull the content from https://openai.com/pricing and distill it in budget mode with query 'API pricing tiers', keeping the result under 300 tokens so I don't blow my context window."},{"title":"Skeleton outline for long documentation","prompt":"Get me a skeleton outline of https://docs.aws.amazon.com/lambda/latest/dg/welcome.html so I can see the high-level structure of the AWS Lambda docs without reading the whole thing."}],"resultDescription":"Returns a 'data' object containing the distilled content (Markdown text, structured JSON tables/metadata, skeleton outline, or BM25-ranked excerpt depending on mode), plus an roi_proof block showing raw token count, distilled token count, tokens saved, compression ratio percentage, estimated LLM cost saved in USD, and ROI multiplier. Also includes optional cache status (HIT/MISS) and billing metadata.","failureModes":["URL is unreachable or returns a non-200 HTTP status — endpoint may return an error status","HTML payload is empty or malformed — distillation may return minimal or empty data","BM25 query provided without mode=budget — query parameter may be ignored","max_tokens set below 20 — schema validation error","Token budget too tight relative to content — result may be heavily truncated","Payment not completed via x402 — 402 Payment Required response before content is returned","Rate limiting or network timeouts on the target URL fetch"],"whenToPreferThis":"Choose this endpoint when you need to compress web content for LLM consumption while controlling token spend — especially when a specific BM25 query focus is needed to extract only the most relevant chunks from a long page. Prefer it over generic scrapers when ROI tracking (tokens saved, cost saved) and multiple distillation modes (markdown, structured, skeleton, budget) are needed in a single call. Ideal for RAG pipelines, agent grounding, and any workflow where raw HTML or large web pages need to be reduced to a manageable, query-focused excerpt.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-21T06:46:56.404Z","isFirstParty":false,"canonicalSlug":"mesh-agentdiet-dev-web-content-distiller-with-bm25-budget-control-22666326"}