{"uid":"cap_bRbSVNFbWWhq7_Z6VjiVt","slug":"agentdiet-dev-agentdiet-web-distiller-with-bm25-budget-control-b4a0e39f","name":"AgentDiet 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://agentdiet.dev/v1/clean-html)","url":"https://agentdiet.dev/v1/clean-html?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_J0tbsZnq9u6CUQKyuTIcF","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"agentdiet.dev","brandSlug":"agentdiet-dev-mpp","brandBaseUrl":"https://agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Fetches and distills a URL or raw HTML into clean Markdown, structured data, a skeleton outline, or a BM25-ranked token-budget excerpt — compressing web content for LLM consumption.","exampleAgentPrompt":"Fetch and distill https://stripe.com/docs/payments/checkout into clean markdown using budget mode, focusing on 'payment session creation', and keep it under 800 tokens.","exampleUseCases":[{"title":"Token-budget research from live URL","prompt":"Pull this competitor pricing page at https://acme.com/pricing and distill it in budget mode with the query 'enterprise plan features', keeping the output under 600 tokens so I can fit it into my analysis prompt."},{"title":"Clean raw HTML from scraped page","prompt":"I've got this messy raw HTML from a scrape — can you distill it into structured tables and metadata? I want the JSON structured mode so I can pull out the key data points without wading through the markup."},{"title":"Skeleton outline of documentation page","prompt":"Grab https://docs.openai.com/api-reference and give me just the skeleton outline so I can see the high-level structure of their API docs without getting buried in the full content."}],"resultDescription":"Returns a `data` object containing the distilled content (Markdown text, structured JSON tables/metadata, skeleton outline, or BM25-ranked excerpt), 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 hit/miss status with latency and billing details.","failureModes":["URL is unreachable or returns a non-200 status — service may return an error status","HTML content is too large or malformed to process — distillation may be partial","mode=budget without a query or max_tokens may produce suboptimal results","Rate limiting or payment failure (x402) if USDC balance is insufficient","Cache miss on first fetch adds latency vs subsequent identical requests","Invalid URL format causes immediate validation error"],"whenToPreferThis":"Choose this endpoint when an AI agent needs to consume web content without exhausting its context window — especially when you need BM25 relevance filtering (budget mode with a query) to extract only the most pertinent chunks from a long page. It is the right choice when you have either a live URL to fetch or raw HTML to process and need the output in a format (Markdown, structured JSON, skeleton, or budget excerpt) that's directly usable in a downstream LLM prompt. Prefer it over generic scraping tools when token compression and cost savings are priorities.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-23T06:37:27.598Z","isFirstParty":false,"canonicalSlug":"agentdiet-dev-agentdiet-web-distiller-with-bm25-budget-control-b4a0e39f"}