{"uid":"cap_NFNBYDl9m8fjPIzKlxSGE","slug":"github-audit-agentdiet-dev-agentdiet-rag-diet-bm25-web-distiller-55ba5633","name":"AgentDiet RAG-Diet BM25 Web Distiller","description":"Distill a URL or raw HTML payload with BM25 budget control (Live x402 v2, IETF MPP & MCP endpoint at https://github-audit.agentdiet.dev/v1/rag-diet)","url":"https://github-audit.agentdiet.dev/v1/rag-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_muZB4fSxQtHz4SZjyMlPt","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"github-audit.agentdiet.dev","brandSlug":"github-audit-agentdiet-dev-mpp","brandBaseUrl":"https://github-audit.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Fetches a URL or accepts raw HTML and distills it into compact agent-ready content with BM25-controlled token budgets across multiple output modes","exampleAgentPrompt":"Distill the content at https://docs.stripe.com/payments/checkout into budget mode focused on 'subscription pricing', keeping it under 800 tokens so I can use it in my RAG pipeline.","exampleUseCases":[{"title":"Token-budget RAG chunk for docs","prompt":"Fetch https://docs.stripe.com/api and distill it in budget mode with the query 'payment intents' and a max of 500 tokens — I want just the relevant parts for my RAG pipeline without burning my LLM context."},{"title":"Structured table extraction from HTML","prompt":"I have this raw HTML from a competitor pricing page — can you distill it in structured mode to pull out all the tables and metadata as JSON so I can compare plans programmatically?"},{"title":"Skeleton outline of long article","prompt":"Distill https://en.wikipedia.org/wiki/Transformer_(deep_learning_architecture) in skeleton mode so I get a compact outline of all the main sections without all the body text."}],"resultDescription":"Returns a `data` object containing the distilled output (Markdown, structured JSON, skeleton outline, or BM25-filtered excerpt depending on mode), plus an `roi_proof` object showing raw token count, distilled token count, tokens saved, compression ratio percentage, ROI multiplier, and estimated LLM cost saved in USD. Also includes cache hit/miss status and billing details.","failureModes":["URL is unreachable or returns non-200 — fetch failure returned","HTML payload too large or malformed — parsing error","mode=budget with no query provided — BM25 ranking unavailable","max_tokens set below minimum of 20 — validation error","Payment not provided or insufficient — HTTP 402 returned","URL resolves to non-HTML content (e.g. PDF, binary) — unsupported content type"],"whenToPreferThis":"Use this endpoint when you need to compress a webpage or HTML blob into a tight token budget before passing it to an LLM, especially when you want BM25 relevance filtering to surface only the most query-relevant content. Prefer it over generic scrapers when token cost reduction and ROI measurement matter — the endpoint returns explicit compression ratios and estimated LLM savings. Choose budget mode when you have a strict token ceiling; use structured mode when you need tabular or metadata extraction; use skeleton mode for outline-only summaries.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-21T00:37:48.095Z","isFirstParty":false,"canonicalSlug":"github-audit-agentdiet-dev-agentdiet-rag-diet-bm25-web-distiller-55ba5633"}