{"uid":"cap_plRPOYPjFbCa9Lnhgze-V","slug":"whale-momentum-agentdiet-dev-web-content-distiller-with-bm25-budget-1cc2b0f7","name":"Web Content 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://whale-momentum.agentdiet.dev/v1/token-optimizer)","url":"https://whale-momentum.agentdiet.dev/v1/token-optimizer?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_svKD7XX2mAH4wP5Weba6i","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"whale-momentum.agentdiet.dev","brandSlug":"whale-momentum-agentdiet-dev-mpp","brandBaseUrl":"https://whale-momentum.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Fetches and distills a URL or raw HTML into compressed Markdown, structured JSON, skeleton outline, or a BM25-ranked token-budget excerpt to reduce LLM context costs","exampleAgentPrompt":"Distill https://docs.stripe.com/api/charges into clean Markdown and keep it under 2000 tokens — use budget mode with the query 'charge object fields' so I only get the most relevant content.","exampleUseCases":[{"title":"LLM-ready documentation distillation","prompt":"Fetch https://docs.openai.com/api-reference and distill it into structured Markdown, keeping it under 3000 tokens — use budget mode with the query 'chat completions parameters' so only the relevant parts make it through."},{"title":"Competitive pricing page extraction","prompt":"Grab the HTML from our competitor's pricing page at https://example-saas.com/pricing and distill it into structured JSON tables so I can see their plan names, prices, and feature tiers without burning a ton of tokens."},{"title":"Research article skeleton for agent pipeline","prompt":"Pull https://arxiv.org/abs/2310.06825 and give me a skeleton outline of the paper — just the section headers and key structural elements — so my agent can decide which sections to read in full."}],"resultDescription":"Returns a data object containing the distilled content (Markdown, structured JSON, skeleton, or BM25 excerpt depending on mode), plus an roi_proof block showing raw token count, distilled token count, tokens saved, compression ratio percentage, LLM cost saved in USD, and ROI multiplier. Also includes cache status (HIT/MISS) and billing details.","failureModes":["URL unreachable or returns non-200 status — fetch error returned","HTML too malformed to parse — distillation may return empty or partial content","max_tokens set below minimum of 20 — validation error","query missing when mode=budget — BM25 ranking skipped or error","Payment not completed via x402 — 402 response before processing","Rate limiting on target URL — fetch timeout or block"],"whenToPreferThis":"Choose this endpoint when an AI agent needs to ingest web content efficiently without blowing token budgets — especially when processing documentation, articles, or product pages before passing to an LLM. It is uniquely valuable for its BM25 budget mode which ranks and trims content by relevance to a query, and its roi_proof response field which quantifies compression gains. Prefer it over generic scrapers when token cost reduction and LLM context management are explicit goals.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-23T06:32:34.305Z","isFirstParty":false,"canonicalSlug":"whale-momentum-agentdiet-dev-web-content-distiller-with-bm25-budget-1cc2b0f7"}