{"uid":"cap_K3N30N-wOx4AVVSi2eLsX","slug":"polymarket-odds-agentdiet-dev-web-distillation-with-bm25-budget-control-1085c820","name":"Web Distillation 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://polymarket-odds.agentdiet.dev/v1/clean-html)","url":"https://polymarket-odds.agentdiet.dev/v1/clean-html?utm_source=zero.xyz","method":"POST","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_Xl4axea10_xynlcssm-gW","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"polymarket-odds.agentdiet.dev","brandSlug":"polymarket-odds-agentdiet-dev-mpp","brandBaseUrl":"https://polymarket-odds.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Fetches and distills a URL or raw HTML into clean Markdown, structured JSON, a skeleton outline, or a BM25-ranked token-budget excerpt","exampleAgentPrompt":"Can you fetch https://stripe.com/docs/api and distill it into clean markdown using budget mode, focused on 'payment intents', keeping it under 800 tokens?","exampleUseCases":[{"title":"LLM-ready documentation compression","prompt":"Grab the OpenAI API reference page at https://platform.openai.com/docs/api-reference and distill it into structured markdown so I can feed it to my LLM without blowing up the context window."},{"title":"BM25-focused competitor pricing extraction","prompt":"Fetch https://www.notion.so/pricing and distill it using budget mode with the query 'team plan pricing' and a max of 500 tokens — I just need the relevant pricing section."},{"title":"Skeleton outline for research navigation","prompt":"Take the Wikipedia page at https://en.wikipedia.org/wiki/Transformer_(deep_learning_architecture) and give me a skeleton outline so I can see the section structure before deciding what to read in full."}],"resultDescription":"Returns a JSON object containing: a 'data' field with the distilled content (Markdown string, structured JSON tables/metadata, skeleton outline, or BM25-ranked excerpt depending on mode); an 'roi_proof' object showing raw vs. distilled token counts, tokens saved, compression ratio percentage, LLM cost saved in USD, and ROI multiplier; a 'cache' object indicating whether the result was a cache HIT or MISS; and an optional 'billing' object with fee charged and payment method used.","failureModes":["URL is unreachable or returns a non-200 status — endpoint may return an error status","Raw HTML is malformed or empty — distillation may return minimal or empty content","mode=budget used without a 'query' parameter — BM25 ranking cannot be applied","max_tokens set below the minimum of 20 — validation error returned","URL resolves to a page requiring JavaScript rendering — static fetch may return incomplete HTML","Rate limiting or payment failure via x402 — 402 Payment Required response"],"whenToPreferThis":"Choose this endpoint when you need to feed web content to an LLM and want to minimize token usage — especially when the source page is large or noisy. The BM25 budget mode is uniquely suited for targeted extraction when you only care about content relevant to a specific query. Prefer this over generic scrapers when you need built-in token-cost accounting (roi_proof) and multiple distillation modes (markdown, structured, skeleton, budget) in a single call. It is also appropriate when you have raw HTML on hand and want to avoid an extra fetch round-trip.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-21T00:36:13.469Z","isFirstParty":false,"canonicalSlug":"polymarket-odds-agentdiet-dev-web-distillation-with-bm25-budget-control-95f2916e"}