{"uid":"cap_dfYnJUNrChDpXDVrujA7z","slug":"prompt-guard-agentdiet-dev-web-url-html-distiller-with-bm25-budget-8f036a94","name":"Web URL HTML 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://prompt-guard.agentdiet.dev/v1/clean-html)","url":"https://prompt-guard.agentdiet.dev/v1/clean-html?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_nvjajvOCU_f9MSC3aK72-","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"prompt-guard.agentdiet.dev","brandSlug":"prompt-guard-agentdiet-dev-mpp","brandBaseUrl":"https://prompt-guard.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Fetches and distills a web URL or raw HTML into compact, agent-ready tokens using configurable extraction modes and optional BM25-ranked token budgeting","exampleAgentPrompt":"Distill this page into compact markdown for me — https://stripe.com/docs/payments — and keep it under 2000 tokens, focused on 'payment intent API'.","exampleUseCases":[{"title":"Research page on tight token budget","prompt":"I need the key info from https://openai.com/pricing but I only have 1500 tokens to spare — can you fetch and distill it using budget mode with the query 'API pricing per token'?"},{"title":"Extract structured tables from docs","prompt":"Pull the structured data from https://docs.aws.amazon.com/general/latest/gr/rande.html and give me it as JSON tables — I want region names and endpoints in a clean format."},{"title":"Convert raw HTML to clean markdown","prompt":"I've got this raw HTML from a product page — can you distill it into clean markdown so I can feed it to my AI agent without wasting tokens on all the junk markup?"}],"resultDescription":"Returns a 'data' object containing distilled content in the requested format (Markdown, structured JSON, skeleton outline, or BM25-ranked excerpt), along with ROI proof metrics (raw vs distilled token counts, compression ratio, tokens saved, estimated LLM cost saved), optional cache hit/miss status, and billing confirmation of the $0.001 fee charged.","failureModes":["Missing required 'url' parameter returns a validation error","Unreachable or invalid URL results in a fetch failure","mode=budget without 'query' parameter may produce unranked results","max_tokens ceiling set too low (below 20) is rejected by schema validation","Rate limiting or payment failure via x402 blocks the request","Highly JavaScript-rendered pages may return incomplete content if server-side rendering is not available"],"whenToPreferThis":"Choose this endpoint when your agent needs to ingest web page content but must minimize token usage and LLM costs — especially useful for long documentation pages, news articles, or HTML-heavy sites. It is ideal when you need BM25-focused extraction around a specific query within a strict token budget. Prefer over raw HTTP fetch + LLM summarization when cost efficiency and structured output (markdown, tables, skeleton) matter. The built-in ROI proof makes it easy to audit compression gains per call.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:25:58.416Z","isFirstParty":false,"canonicalSlug":"prompt-guard-agentdiet-dev-web-url-html-distiller-with-bm25-budget-8f036a94"}