{"uid":"cap_P99y59P0Ml9ux-j8Gz_FX","slug":"x402-audit-agentdiet-dev-url-to-markdown-distiller-with-bm25-budget-9e8c7cea","name":"URL to Markdown 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://x402-audit.agentdiet.dev/v1/url-to-markdown)","url":"https://x402-audit.agentdiet.dev/v1/url-to-markdown?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_E4GXEFVOpd1HCG6W0yHEd","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"x402-audit.agentdiet.dev","brandSlug":"x402-audit-agentdiet-dev-mpp","brandBaseUrl":"https://x402-audit.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Fetches a URL or raw HTML and distills it into compact, agent-ready Markdown, structured JSON, skeleton outline, or BM25-focused token-budget excerpt","exampleAgentPrompt":"Fetch https://stripe.com/docs/api and distill it into markdown with a 2000-token budget, focusing on the query 'payment intents'.","exampleUseCases":[{"title":"Token-budget webpage reading for agents","prompt":"Pull https://openai.com/pricing and give me the content as markdown, but cap it at 1500 tokens — I want the pricing table without blowing my context window."},{"title":"BM25-focused research extraction","prompt":"Fetch https://docs.anthropic.com/claude/reference/getting-started and extract only the parts relevant to 'rate limits', keeping it under 800 tokens in budget mode."},{"title":"Structured data extraction from a webpage","prompt":"Distill https://finance.yahoo.com/quote/AAPL into structured JSON mode so I can pull out the key financial metrics as clean tables."}],"resultDescription":"Returns a JSON object containing the distilled content (Markdown text, structured JSON tables/metadata, skeleton outline, or BM25-ranked excerpt depending on mode), plus an roi_proof block showing raw vs distilled token counts, compression ratio percentage, tokens saved, and estimated LLM cost saved in USD. Also includes optional cache status (HIT/MISS) and billing details.","failureModes":["URL is unreachable or returns non-200 (network error or timeout)","HTML parsing fails for malformed or JS-heavy pages that require rendering","max_tokens set below meaningful content threshold (minimum 20)","BM25 query in budget mode returns empty excerpt if no matching content","Payment/402 authentication failure if agent lacks valid x402 credentials","Invalid mode enum value returns validation error"],"whenToPreferThis":"Choose this endpoint when an AI agent needs to read a webpage but must conserve context tokens — especially with the budget mode and BM25 query parameter for pinpoint relevance. It is ideal over generic scrapers when you want quantified token savings and compression ratios returned alongside content, or when you need structured JSON tables extracted from web pages rather than raw HTML dumps.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:26:00.257Z","isFirstParty":false,"canonicalSlug":"x402-audit-agentdiet-dev-url-to-markdown-distiller-with-bm25-budget-9e8c7cea"}