{"uid":"cap_HB-rsEmnHPVGQBPIgSgLr","slug":"workflows-agentdiet-dev-agentdiet-bm25-budget-controlled-web-distiller-70fae633","name":"AgentDiet BM25 Budget-Controlled Web Distiller","description":"Distill a URL or raw HTML payload with BM25 budget control (Live x402 v2, IETF MPP & MCP endpoint at https://workflows.agentdiet.dev/api/diet)","url":"https://workflows.agentdiet.dev/api/diet?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_u1bd209YGIodw4I_qpBC2","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"workflows.agentdiet.dev","brandSlug":"workflows-agentdiet-dev-mpp","brandBaseUrl":"https://workflows.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Fetches and distills a URL or raw HTML into compact, token-efficient output using BM25 budget control to focus on a query within a strict token ceiling","exampleAgentPrompt":"Distill the page at https://stripe.com/docs/payments into a BM25 budget excerpt focused on 'webhook events', keeping it under 300 tokens so I can fit it in my context window.","exampleUseCases":[{"title":"LLM-friendly doc lookup within token budget","prompt":"Fetch https://docs.openai.com/api-reference and distill it in budget mode focused on 'rate limits', capping the output at 400 tokens — I need just the relevant bits without blowing my context."},{"title":"Structured product data from e-commerce page","prompt":"Take this URL https://www.apple.com/iphone and distill it in structured mode so I get the product tables and pricing metadata in a compact JSON format."},{"title":"Compress raw HTML for downstream agent processing","prompt":"I have a raw HTML blob from a scraped news article — can you distill it into clean markdown using skeleton mode so my agent can quickly read the outline and headings?"}],"resultDescription":"Returns a JSON object containing distilled content (markdown, structured JSON tables/metadata, skeleton outline, or BM25 budget excerpt), plus an ROI proof block showing raw vs distilled token counts, compression ratio percentage, tokens saved, estimated LLM cost saved in USD, and an ROI multiplier. Also includes cache status (HIT/MISS) and billing details.","failureModes":["Invalid or unreachable URL returns a fetch error","Raw HTML too malformed to parse returns a distillation error","max_tokens set below minimum of 20 returns a validation error","BM25 mode without a query field may return unranked or full excerpt","Rate limiting or payment failure returns HTTP 402","Idempotency key collision may return cached prior result"],"whenToPreferThis":"Choose this endpoint when an AI agent needs to read web content but must stay within a strict token budget — especially useful when using BM25 mode to focus on a specific query topic within a large page. Prefer it over generic scrapers when token efficiency and LLM cost savings are primary concerns, or when you need structured extraction (tables, metadata) or skeleton outlines rather than full-page dumps.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-23T06:30:48.258Z","isFirstParty":false,"canonicalSlug":"workflows-agentdiet-dev-agentdiet-bm25-budget-controlled-web-distiller-70fae633"}