{"uid":"cap_d92LdfLm_r9WdFP2vtF1K","slug":"polymarket-odds-agentdiet-dev-web-distillation-with-bm25-budget-control-95f2916e","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/rag-diet)","url":"https://polymarket-odds.agentdiet.dev/v1/rag-diet?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_G8GFxV5uXSJAc_0EjCJ0r","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 Markdown, structured data, skeleton outlines, or BM25-ranked token-budgeted excerpts for RAG pipelines","exampleAgentPrompt":"Can you distill https://stripe.com/docs/api into clean markdown using BM25 budget mode, focused on the query 'payment intents', and keep it under 2000 tokens?","exampleUseCases":[{"title":"RAG pipeline page compression","prompt":"Distill this product page at https://example.com/shop/widgets into structured markdown so I can feed it into my RAG pipeline without blowing my token budget — keep it under 1500 tokens."},{"title":"BM25 focused research extraction","prompt":"I'm researching SEC filing requirements. Can you fetch https://www.sec.gov/cgi-bin/browse-edgar and extract only the sections most relevant to my query 'annual report 10-K deadlines', using budget mode with a max of 1000 tokens?"},{"title":"Competitor pricing page analysis","prompt":"Pull the pricing page at https://competitor.com/pricing and give me a structured JSON breakdown of their product tiers, prices, and features — use structured mode so I get clean tables."}],"resultDescription":"Returns a JSON object with a 'data' field containing the distilled content (Markdown string, structured JSON tables/metadata, skeleton outline, or BM25-ranked excerpt depending on mode), plus an 'roi_proof' object showing raw_tokens, distilled_tokens, tokens_saved, compression_ratio_pct, roi_multiplier, and llm_cost_saved_usd. Also includes cache status (HIT/MISS), billing details, and an overall status field.","failureModes":["URL unreachable or returns non-200 status — distillation fails with fetch error","HTML payload too large or malformed — parser may return partial results","max_tokens set too low relative to content — may yield truncated or empty excerpt","BM25 query not provided when mode=budget — may default to full content or error","Paywalled or JavaScript-heavy pages may return incomplete HTML","Payment not processed (402) — endpoint returns 402 requiring x402 micropayment"],"whenToPreferThis":"Use this endpoint when you need to reduce webpage or HTML content to a token-efficient form before feeding it to an LLM, especially when you have a strict token budget or want BM25-ranked relevance filtering. It is ideal for RAG ingestion pipelines, competitive research, and any workflow where raw web content would otherwise exceed context window limits or inflate LLM costs. Prefer it over generic scrapers when you need built-in compression metrics and ROI proof of token savings.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-21T12:40:50.507Z","isFirstParty":false,"canonicalSlug":"polymarket-odds-agentdiet-dev-web-distillation-with-bm25-budget-control-95f2916e"}