{"uid":"cap_COOSXXwFASN7JV-vYM9S7","slug":"mesh-agentdiet-dev-agentdiet-web-distiller-with-bm25-budget-control-74fd9b71","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://mesh.agentdiet.dev/api/diet)","url":"https://mesh.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_1rqr8NnL_dqeTOenwxRkb","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"mesh.agentdiet.dev","brandSlug":"mesh-agentdiet-dev-mpp","brandBaseUrl":"https://mesh.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Fetches and distills a URL or raw HTML into compact markdown, structured JSON, a skeleton outline, or a BM25-ranked budget excerpt within a strict token ceiling","exampleAgentPrompt":"Distill the page at https://stripe.com/docs/api into clean markdown and keep it under 800 tokens, focusing on the authentication section.","exampleUseCases":[{"title":"Token-budget scraping for LLM context","prompt":"Fetch https://openai.com/blog/gpt-4 and distill it into markdown but cap it at 500 tokens — I need to fit it inside my prompt window."},{"title":"BM25 focused excerpt from competitor page","prompt":"Pull https://docs.anthropic.com/claude/reference/getting-started-with-the-api and give me only the parts most relevant to 'rate limits and pricing' using budget mode with a 300-token ceiling."},{"title":"Structured data extraction from product page","prompt":"Distill this raw HTML into structured JSON tables so I can pull out the pricing tiers and feature list without all the navigation clutter."}],"resultDescription":"Returns a JSON object with a 'data' field containing the distilled content (markdown text, structured tables/metadata, skeleton outline, or BM25-ranked excerpt), plus an 'roi_proof' object showing raw token count, distilled token count, tokens saved, compression ratio percentage, and estimated LLM cost saved in USD. Also includes cache hit/miss status and billing details.","failureModes":["URL is unreachable or returns non-200 — endpoint may return an error status","Raw HTML too large to process within limits","mode=budget used without providing a query — BM25 ranking cannot operate","max_tokens set below 20 (minimum) — validation error","Payment not included or insufficient — HTTP 402 returned","Invalid URL format — schema validation failure"],"whenToPreferThis":"Choose this endpoint when an AI agent needs to ingest live web content but must stay within a token budget — especially when using mode=budget with a BM25 query to surface only the most relevant passage from a large page. Prefer over generic scrapers when you need built-in compression metrics, ROI proof of token savings, or structured JSON extraction from HTML. Ideal for agents doing research, competitive intelligence, or documentation lookups where context-window cost matters.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-23T06:33:12.428Z","isFirstParty":false,"canonicalSlug":"mesh-agentdiet-dev-agentdiet-web-distiller-with-bm25-budget-control-ea9888a4"}