{"uid":"cap_53nPnxpHnQFi4S9xOnANu","slug":"shopify-intel-agentdiet-dev-bm25-budget-controlled-url-html-distiller-c4b755d8","name":"BM25 Budget-Controlled URL & HTML Distiller","description":"Distill a URL or raw HTML payload with BM25 budget control (Live x402 v2, IETF MPP & MCP endpoint at https://shopify-intel.agentdiet.dev/v1/token-optimizer)","url":"https://shopify-intel.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_1Fad4Jl3KGKDoQGU8zjtd","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"shopify-intel.agentdiet.dev","brandSlug":"shopify-intel-agentdiet-dev-mpp","brandBaseUrl":"https://shopify-intel.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Fetches and distills a URL or raw HTML payload into compact agent-ready tokens using BM25-scored budget control with configurable output modes","exampleAgentPrompt":"Distill the content at https://docs.stripe.com/payments/quickstart into compact markdown using budget mode, focused on the query 'payment intent setup', and keep it under 500 tokens.","exampleUseCases":[{"title":"Fit product page into LLM context","prompt":"Grab https://www.shopify.com/pricing and compress it into structured markdown under 300 tokens — I only care about the pricing tiers and what's included in each plan."},{"title":"BM25 excerpt for research question","prompt":"I need a tight excerpt from https://en.wikipedia.org/wiki/Transformer_(machine_learning_model) focused on the query 'attention mechanism' — keep it under 400 tokens using budget mode."},{"title":"Distill raw HTML from email scrape","prompt":"I have raw HTML from a product listing page — distill it into a clean skeleton outline so I can see just the headings and key structural elements without all the noise."}],"resultDescription":"Returns a JSON object with a 'data' field containing the distilled content (markdown, structured tables/metadata, skeleton outline, or BM25-ranked excerpt depending on mode), an ROI proof block showing raw vs distilled token counts, compression ratio, tokens saved, and estimated LLM cost saved in USD, plus optional cache hit/miss status and billing details.","failureModes":["URL is unreachable or returns non-200 — fetch failure error","URL resolves to non-HTML content (PDF, binary) — parse failure","Token budget too small (below minimum of 20) — validation error","BM25 query missing when mode=budget — may return unfiltered excerpt","Raw HTML is malformed or empty — distillation returns minimal output","Payment not provided or insufficient — HTTP 402 payment required","Rate limiting or timeout on slow remote pages — latency error"],"whenToPreferThis":"Choose this endpoint when you need to feed web content to an LLM but must stay within a strict token budget, especially when BM25 query-relevance filtering is needed to extract only the most pertinent sections. It is ideal for agentic pipelines where LLM context costs matter and raw page content is too large. Prefer it over generic scrapers when you need built-in token accounting, ROI proof, and multiple output modes (markdown, structured, skeleton, budget).","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-23T06:30:52.355Z","isFirstParty":false,"canonicalSlug":"shopify-intel-agentdiet-dev-bm25-budget-controlled-url-html-distiller-c4b755d8"}