{"uid":"cap_NWHNtcQNdaa66kOkywkDc","slug":"github-audit-agentdiet-dev-agentdiet-rag-token-diet-web-url-distiller-4010be30","name":"AgentDiet RAG Token Diet – Web URL 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-token-diet)","url":"https://github-audit.agentdiet.dev/v1/rag-token-diet?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_Yp2dhrNi1MoVpFiKEHBfS","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 webpage (or accepts raw HTML) and compresses it into compact, agent-ready tokens using markdown, structured, skeleton, or BM25 budget-controlled distillation modes","exampleAgentPrompt":"Distill the content at https://stripe.com/docs/api into compact markdown so I can fit it into my context window — keep it under 1500 tokens using budget mode and focus the BM25 query on 'payment intents'.","exampleUseCases":[{"title":"Distill docs page for RAG pipeline","prompt":"Fetch and distill https://docs.openai.com/api-reference into clean markdown under 2000 tokens — use budget mode with the BM25 query focused on 'function calling'."},{"title":"Extract structured product info from e-commerce page","prompt":"Pull the page at https://www.apple.com/shop/buy-iphone and distill it into structured JSON tables so I can see the product variants and prices without wading through all the HTML."},{"title":"Skeleton outline of a long article","prompt":"Give me a skeleton outline of this article — https://en.wikipedia.org/wiki/Large_language_model — just the headings and key structure so I can decide which section to read in full."}],"resultDescription":"Returns a distilled version of the webpage content in the requested format (markdown, structured JSON, skeleton outline, or BM25-focused budget excerpt), plus an roi_proof object showing raw token count, distilled token count, tokens saved, compression ratio percentage, estimated LLM cost saved in USD, and a cache status object indicating HIT or MISS.","failureModes":["URL is unreachable or returns a non-200 status — endpoint may return an error status","HTML payload is malformed or too large to process","mode=budget specified without a query parameter, resulting in unguided compression","max_tokens set too low to return meaningful content","Payment not completed (HTTP 402) — request is blocked until x402 payment is fulfilled","Target URL blocks bots or requires authentication, resulting in empty or truncated content"],"whenToPreferThis":"Choose this endpoint when you need to reduce token consumption before inserting web content into an LLM prompt or RAG pipeline, especially when operating under strict context-window budgets. It is particularly valuable when mode=budget with a BM25 query is used to extract only the most topically relevant tokens from a page. Prefer it over raw web scrapers when you care about token efficiency and cost savings, and over general summarizers when you need structured output formats like JSON tables or skeleton outlines rather than prose summaries.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:25:44.532Z","isFirstParty":false,"canonicalSlug":"github-audit-agentdiet-dev-agentdiet-rag-token-diet-web-url-distiller-4010be30"}