{"uid":"cap_gh_MvE0elE16EBo6TT2I0","slug":"sec-intel-agentdiet-dev-web-distillation-bm25-budget-controlled-d9c68c98","name":"Web Distillation & BM25 Budget-Controlled Context Compression","description":"Distill a URL or raw HTML payload with BM25 budget control (Live x402 v2, IETF MPP & MCP endpoint at https://sec-intel.agentdiet.dev/v1/context-diet)","url":"https://sec-intel.agentdiet.dev/v1/context-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_yDFj37iroYx3A8YL5funM","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"sec-intel.agentdiet.dev","brandSlug":"sec-intel-agentdiet-dev-mpp","brandBaseUrl":"https://sec-intel.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Fetches and distills a URL or raw HTML into compact Markdown, structured JSON, or a BM25-ranked token-budget excerpt for LLM context efficiency","exampleAgentPrompt":"Fetch https://stripe.com/docs/api and distill it in budget mode focused on 'payment intents' with a max of 500 tokens so I can use it as context without blowing my LLM budget.","exampleUseCases":[{"title":"Distill documentation page for agent context","prompt":"Grab the OpenAI API docs at https://platform.openai.com/docs/guides/function-calling and distill them into clean markdown so I can feed it into my agent without using up all my context window."},{"title":"BM25-ranked excerpt from financial filing","prompt":"Pull this SEC 10-K filing URL and return only the sections most relevant to 'revenue recognition' in budget mode with a 300 token ceiling — I need just the key facts, not the whole document."},{"title":"Structured data extraction from product page","prompt":"Distill https://example.com/product/widget-pro in structured mode and give me the tables and metadata so my agent can compare specs without reading the whole page."}],"resultDescription":"Returns a JSON object with a 'data' field containing the distilled content (Markdown text, 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) and optional billing details.","failureModes":["URL is unreachable or returns non-200 — endpoint may return an error status","HTML content is too sparse or empty — distilled output may be minimal","max_tokens set too low — may produce truncated or empty budget excerpts","BM25 query not matched — budget mode may return low-relevance content","Rate limit or payment failure — 402 payment required if USDC balance is insufficient","Invalid mode enum value — request rejected with validation error"],"whenToPreferThis":"Choose this endpoint when an AI agent needs to ingest web content efficiently without exhausting its context window — especially when you have a strict token budget or want BM25-ranked relevance filtering. Prefer it over generic scrapers when you need ROI metrics on compression, when you want multiple distillation modes (markdown/structured/skeleton/budget) in one call, or when working with known sources like Stripe docs via the builtin:// protocol. It is particularly valuable in agentic pipelines where LLM token costs matter.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-28T06:43:18.136Z","isFirstParty":false,"canonicalSlug":"sec-intel-agentdiet-dev-web-distillation-bm25-budget-controlled-d9c68c98"}