{"uid":"cap_lqp_j5F2XmZ9-XEF_SUsV","slug":"arxiv-digest-agentdiet-dev-web-url-distiller-with-bm25-budget-control-044c0cc8","name":"Web URL 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://arxiv-digest.agentdiet.dev/v1/rag-chunk)","url":"https://arxiv-digest.agentdiet.dev/v1/rag-chunk?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_YaoWatRlXDlpgO0ByYcou","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"arxiv-digest.agentdiet.dev","brandSlug":"arxiv-digest-agentdiet-dev-mpp","brandBaseUrl":"https://arxiv-digest.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Fetches a URL or raw HTML and compresses it into compact, agent-ready tokens with configurable distillation modes and BM25-based token budget control","exampleAgentPrompt":"Distill the content at https://arxiv.org/abs/2310.06825 into clean markdown using budget mode with a BM25 query of 'transformer attention mechanism' and cap it at 500 tokens.","exampleUseCases":[{"title":"RAG ingestion on a tight token budget","prompt":"Grab the content from https://openai.com/research/gpt-4 and distill it down to at most 300 tokens using budget mode, focused on 'model capabilities and benchmarks' — I need it compact enough to fit in my RAG context window."},{"title":"Structured data extraction from documentation","prompt":"Fetch https://stripe.com/docs/api/charges and give me a structured distillation — I want tables and metadata pulled out cleanly so my agent can parse pricing and parameter info."},{"title":"Skeleton outline for rapid navigation","prompt":"Get the skeleton outline of https://docs.python.org/3/library/asyncio.html so I can see the high-level structure and section headers without pulling in all the body text."}],"resultDescription":"Returns a JSON object containing the distilled content (markdown, structured tables/metadata, skeleton outline, or BM25-filtered excerpt), an ROI proof block showing raw vs. distilled token counts, compression ratio, tokens saved, and estimated LLM cost saved in USD, plus optional billing and cache metadata.","failureModes":["URL is unreachable or returns non-200 status — endpoint may return an error status field","Raw HTML not provided when URL fetch fails — missing required input","mode=budget used without query or max_tokens — may default to full markdown","Token budget too small (below 20) — rejected by schema validation","Payment not fulfilled via x402 — 402 response returned before processing","URL content is too large or protected by bot detection — fetch may fail or return partial content"],"whenToPreferThis":"Choose this endpoint when you need to compress web content before passing it to an LLM, especially when token cost is a concern or your context window is limited. It is ideal for RAG pipelines that ingest live URLs, for agents that need to read documentation pages compactly, or when you want BM25-ranked relevance filtering to focus on a specific topic within a large page. Prefer it over raw fetch+parse when you want measurable compression ROI and multiple output format options (markdown, structured, skeleton, budget).","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:25:37.807Z","isFirstParty":false,"canonicalSlug":"arxiv-digest-agentdiet-dev-web-url-distiller-with-bm25-budget-control-044c0cc8"}