{"uid":"cap_eOT2WgDL0aNOt7Dr3sFm2","slug":"mesh-agentdiet-dev-html-to-markdown-distiller-with-bm25-budget-control-a73b1dd4","name":"HTML-to-Markdown 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/html-to-markdown)","url":"https://mesh.agentdiet.dev/v1/html-to-markdown?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_p-xyfhxRLQ3nGuWAlcFKE","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 a URL or accepts raw HTML and converts it to compact Markdown, structured JSON, skeleton outline, or a BM25-ranked token-budget excerpt","exampleAgentPrompt":"Fetch https://stripe.com/docs/api and distill it into compact markdown using budget mode with 'payment intents' as my BM25 focus query and a strict ceiling of 2000 tokens.","exampleUseCases":[{"title":"Token-efficient documentation lookup","prompt":"Grab the content from https://docs.openai.com/api-reference and distill it into markdown, keeping it under 1500 tokens — focus the BM25 budget on 'embeddings endpoint'."},{"title":"Structured data extraction from a webpage","prompt":"Take the HTML from this product listing page https://example.com/products and convert it into structured JSON tables so I can see the pricing and specs cleanly."},{"title":"Skeleton outline of a long article","prompt":"Fetch https://en.wikipedia.org/wiki/Large_language_model and give me a skeleton outline of the page so I can see the document structure without all the body text."}],"resultDescription":"Returns a JSON object containing distilled content (Markdown, structured JSON, skeleton, or BM25 excerpt), an ROI proof block showing raw vs distilled token counts, compression ratio, and estimated LLM cost saved, plus optional cache status and billing details.","failureModes":["URL is unreachable or returns non-200 — fetch failure error","HTML is empty or unparseable — distillation returns empty or error status","mode=budget used without a query field — BM25 ranking cannot execute","max_tokens set below 20 — violates minimum constraint and returns validation error","Payment not provided or insufficient — x402 payment required response","Target site blocks automated fetching — returns fetch blocked or empty content"],"whenToPreferThis":"Choose this endpoint when an AI agent needs to ingest live web content without blowing its context window budget — especially when a strict token ceiling is needed via BM25 budget mode. Prefer over generic scrapers when you need token savings telemetry (compression ratio, LLM cost saved) alongside the content, or when you need structured JSON tables or skeleton outlines rather than raw HTML. Best suited for agents that process documentation, research pages, or product listings and need to keep LLM costs low.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-23T06:35:14.523Z","isFirstParty":false,"canonicalSlug":"mesh-agentdiet-dev-html-to-markdown-distiller-with-bm25-budget-control-a73b1dd4"}