{"uid":"cap_ZHxr_asq-RABVx1NitSCL","slug":"domain-osint-agentdiet-dev-html-to-markdown-distiller-with-bm25-9ba72f83","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://domain-osint.agentdiet.dev/v1/html-to-markdown)","url":"https://domain-osint.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_-CRt1xceZC_nulGsRllv9","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"domain-osint.agentdiet.dev","brandSlug":"domain-osint-agentdiet-dev-mpp","brandBaseUrl":"https://domain-osint.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Fetches a URL or accepts raw HTML and distills it into token-efficient Markdown, structured JSON, skeleton outlines, or BM25-ranked budget excerpts focused on a query.","exampleAgentPrompt":"Fetch https://stripe.com/docs/api and distill it into clean Markdown using budget mode, focusing on 'payment intents' with a max of 2000 tokens so I can fit it into my LLM context.","exampleUseCases":[{"title":"LLM context window cost reduction","prompt":"Pull https://openai.com/blog/gpt-4o and convert it to Markdown — I want the token-efficient version so I can include it in my prompt without blowing my context budget."},{"title":"BM25-focused doc excerpt for RAG pipeline","prompt":"Distill https://docs.aws.amazon.com/lambda/latest/dg/welcome.html in budget mode, focused on 'cold start latency', and cap it at 1500 tokens so only the relevant parts come through."},{"title":"Raw HTML cleanup for downstream parsing","prompt":"I have a raw HTML blob from a scraped product page — distill it into structured mode so I get the tables and metadata as clean JSON instead of messy HTML."}],"resultDescription":"Returns a distilled representation of the webpage or HTML in one of four modes: Markdown (clean text), structured (JSON tables and metadata), skeleton (outline), or budget (BM25-ranked excerpt trimmed to token ceiling). Also returns an ROI proof object showing raw vs. distilled token counts, compression ratio, tokens saved, and estimated LLM cost savings, plus optional billing and cache status.","failureModes":["URL is unreachable or returns non-200 — fetch fails and status reflects error","HTML payload is empty or malformed — distillation may return minimal output","max_tokens set too low — output may be severely truncated or empty","BM25 query provided without mode=budget — query may be ignored","Payment not provided or insufficient — HTTP 402 returned blocking execution","Rate limiting or server-side timeout for very large pages"],"whenToPreferThis":"Choose this endpoint when you need to reduce the token footprint of web content before feeding it to an LLM — especially when you want BM25-ranked, query-focused excerpts rather than full-page dumps. It is preferable to generic scraping APIs when token cost and context window management matter, and when you need ROI proof of compression savings. The budget mode makes it uniquely suited for RAG pipelines and agent workflows with strict token budgets.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-21T12:35:22.326Z","isFirstParty":false,"canonicalSlug":"domain-osint-agentdiet-dev-html-to-markdown-distiller-with-bm25-9ba72f83"}