{"uid":"cap_IdbOuSWztbeDWpSmJLD9O","slug":"agentdiet-rag-diet-web-url-distillation-token-compression-cd41f200","name":"AgentDiet RAG Diet – Web URL Distillation & Token Compression","description":"Distill a web URL into compact agent-ready tokens (Live x402 v2, IETF MPP & MCP endpoint at https://mesh.agentdiet.dev/v1/rag-diet)","url":"https://mesh.agentdiet.dev/v1/rag-diet?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","minLength":1,"description":"Target webpage URL to distill (or builtin://stripe-docs)"},"mode":{"enum":["markdown","structured","skeleton","budget"],"type":"string","default":"markdown","description":"Extraction mode: markdown, structured, skeleton, or budget"},"limit":{"type":"integer","default":20,"maximum":100,"minimum":1,"description":"Maximum number of items to return per page (1-100)"},"query":{"type":"string","description":"BM25 focus query when mode=budget"},"cursor":{"type":"string","description":"Opaque pagination cursor for fetching the next page"},"max_tokens":{"type":"integer","minimum":20,"description":"Strict token 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":["x402"],"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":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},{"kind":"static","protocol":"mpp","network":"tempo","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_opX41eCxpJhFfpb1q4pez","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null},{"uid":"pm_fNLqh2gxWrB9uNnkJvLNX","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Fetches a web URL and distills it into compact, agent-ready tokens using configurable extraction modes (markdown, structured, skeleton, or BM25 budget), dramatically reducing token usage for downstream LLM calls.","exampleAgentPrompt":"Can you distill https://stripe.com/docs/payments into compact markdown — I want no more than 50 items returned so I don't blow my token budget?","exampleUseCases":[{"title":"RAG pipeline web page compression","prompt":"I need to feed this documentation page at https://docs.openai.com/api-reference into my RAG system — can you distill it into structured JSON tables with a max of 30 items so it fits in my context window?"},{"title":"Budget-capped news article extraction","prompt":"Pull the article at https://techcrunch.com/2024/05/01/openai-news and give me only the most relevant excerpt about funding rounds — use budget mode with a BM25 query of 'funding valuation' and cap it at 500 tokens."},{"title":"Skeleton outline for quick agent navigation","prompt":"Can you grab https://en.wikipedia.org/wiki/Large_language_model and return just the skeleton outline so my agent can see the page structure without loading the full content?"}],"resultDescription":"Returns a 'data' object containing distilled content in the requested format (Markdown text, structured JSON tables/metadata, skeleton outline, or BM25-ranked excerpt), plus ROI proof metrics (raw token count, distilled token count, tokens saved, compression ratio, estimated LLM cost saved), optional cache hit/miss status, and billing info.","failureModes":["Invalid or unreachable URL returns an error status","URL behind authentication or paywall may return incomplete content","Token ceiling too low for meaningful extraction in budget mode — may return truncated or empty results","Unsupported mode enum value causes a validation error","Rate limiting or upstream 402 payment required if micropayment not attached"],"whenToPreferThis":"Choose this endpoint when an AI agent needs to read and process web pages without burning large token budgets — especially in RAG pipelines, document Q&A, or any workflow where LLM context cost matters. It is preferable to raw web scraping when you need structured or Markdown output with built-in token budgeting and ROI metrics. Use the BM25 budget mode when you only need the most relevant excerpt around a specific query rather than the full page.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-19T18:36:26.209Z","isFirstParty":false,"canonicalSlug":"agentdiet-rag-diet-web-url-distillation-token-compression-cd41f200"}