{"uid":"cap_yanv8_dSWu-kkEX--vmwe","slug":"x402-audit-agentdiet-dev-html-to-markdown-web-distiller-with-bm25-6078abea","name":"HTML-to-Markdown Web 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://x402-audit.agentdiet.dev/v1/html-to-markdown)","url":"https://x402-audit.agentdiet.dev/v1/html-to-markdown?utm_source=zero.xyz","method":"GET","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_mexdYkeAATRxSZdMZ8BnJ","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"x402-audit.agentdiet.dev","brandSlug":"x402-audit-agentdiet-dev-mpp","brandBaseUrl":"https://x402-audit.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Fetches a URL or accepts raw HTML and converts it into compact, agent-ready Markdown, structured JSON, skeleton outline, or BM25-filtered token-budgeted excerpts","exampleAgentPrompt":"Fetch the page at https://docs.stripe.com/payments/accept-a-payment and distill it into compact markdown, keeping it under 2000 tokens and focusing on the topic 'payment intents'.","exampleUseCases":[{"title":"Research page summarized for agent context","prompt":"Grab https://openai.com/research/gpt-4 and distill it into clean markdown so I can drop it into my agent's context window without blowing my token budget."},{"title":"BM25 budget excerpt for targeted Q&A","prompt":"Fetch https://docs.aws.amazon.com/lambda/latest/dg/welcome.html and pull out only the sections most relevant to 'cold start latency', keeping the output under 500 tokens."},{"title":"Structured data extraction from a product page","prompt":"Convert https://www.bestbuy.com/site/apple-macbook-pro/123456.p into structured JSON tables showing the product specs and pricing details."}],"resultDescription":"Returns a JSON object containing: (1) distilled content under 'data' — Markdown text, structured JSON tables, skeleton outline, or BM25-filtered excerpt depending on mode; (2) 'roi_proof' metrics including raw token count, distilled token count, tokens saved, compression ratio percentage, ROI multiplier, and estimated LLM cost saved in USD; (3) optional 'cache' metadata indicating HIT/MISS and latency; (4) optional 'billing' details including agent ID, payment method, and fee charged.","failureModes":["Invalid or unreachable URL returns an error status","Raw HTML input too large may time out or be rejected","mode=budget without a query or max_tokens may return unfiltered content","Paywalled or JavaScript-heavy pages may yield empty or minimal content","Token budget too low (below 20) returns a validation error","HTTP 402 payment required if x402 payment not provided"],"whenToPreferThis":"Choose this endpoint when an AI agent needs to read and process web pages without exhausting its context window — especially when token efficiency matters. It is particularly valuable when you want BM25-focused excerpts to answer a specific question from a long page, or when you need structured JSON tables extracted from HTML rather than raw prose. Prefer this over a generic web scraper when you need built-in token budget enforcement and ROI metrics for LLM cost tracking.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:21:12.538Z","isFirstParty":false,"canonicalSlug":"x402-audit-agentdiet-dev-html-to-markdown-web-distiller-with-bm25-6078abea"}