{"uid":"cap_Sc5VSNqM2CwvNpWlrUiic","slug":"onchain-risk-agentdiet-dev-web-url-distiller-bm25-budget-markdown-17f01c4a","name":"Web URL Distiller (BM25 Budget, Markdown, Structured, Skeleton)","description":"Distill a URL or raw HTML payload with BM25 budget control (Live x402 v2, IETF MPP & MCP endpoint at https://onchain-risk.agentdiet.dev/v1/spa-markdown-reader)","url":"https://onchain-risk.agentdiet.dev/v1/spa-markdown-reader?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_f96sgmZ_O2n3jrOHWxlz0","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"onchain-risk.agentdiet.dev","brandSlug":"onchain-risk-agentdiet-dev-mpp","brandBaseUrl":"https://onchain-risk.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Fetches a URL or raw HTML and distills it into compact, agent-ready tokens using configurable extraction modes (markdown, structured, skeleton, or BM25-focused budget) with a strict token ceiling.","exampleAgentPrompt":"Can you fetch https://stripe.com/docs/payments and distill it into compact markdown, keeping it under 2000 tokens using budget mode with the query 'payment intents'?","exampleUseCases":[{"title":"RAG pipeline page compression","prompt":"Distill https://docs.openai.com/api-reference into structured markdown for me — I need it compact enough to fit in my LLM context window, so use budget mode with a max of 3000 tokens and focus the BM25 query on 'chat completions'."},{"title":"Competitive pricing page extraction","prompt":"Fetch https://www.notion.so/pricing and extract it in structured mode so I get the pricing tiers and plan details as clean JSON tables I can compare."},{"title":"Skeleton outline of a long article","prompt":"Take https://en.wikipedia.org/wiki/Transformer_(machine_learning_model) and give me a skeleton outline of the page structure — just the headings and key sections, nothing more."}],"resultDescription":"Returns a 'data' object containing the distilled content in the requested format (Markdown string, structured JSON tables/metadata, skeleton heading outline, or BM25-ranked excerpt), along with an roi_proof block showing raw_tokens, distilled_tokens, tokens_saved, compression_ratio_pct, and llm_cost_saved_usd. Also includes cache status (HIT/MISS) and billing details.","failureModes":["URL is unreachable or returns a non-200 status — endpoint may return an error status","HTML payload is malformed or too large — distillation may fail or truncate","max_tokens set too low (below 20) — rejected by schema validation","mode=budget used without a query — BM25 ranking may produce generic output","Paywalled or JS-rendered pages may not be fully fetched — content may be partial","Payment/402 not resolved — call fails with HTTP 402 if billing is not configured"],"whenToPreferThis":"Choose this endpoint when you need to compress a live webpage or raw HTML into a token-efficient format for LLM context windows, RAG pipelines, or agent workflows — especially when you want BM25-focused excerpts around a specific query, structured JSON tables from a page, or a skeleton outline. Prefer it over generic scrapers when token budget control and compression metrics (roi_proof) are important, or when you need multiple distillation modes from a single endpoint.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:21:06.534Z","isFirstParty":false,"canonicalSlug":"onchain-risk-agentdiet-dev-web-url-distiller-bm25-budget-markdown-17f01c4a"}