{"uid":"cap_YuzYMQ6uAOUxehhSn9_aE","slug":"github-audit-agentdiet-dev-web-url-html-distiller-with-bm25-budget-d63452b7","name":"Web URL & HTML 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://github-audit.agentdiet.dev/v1/token-optimizer)","url":"https://github-audit.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_E_WsRyMiQpjTLFQ6lFiNB","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"github-audit.agentdiet.dev","brandSlug":"github-audit-agentdiet-dev-mpp","brandBaseUrl":"https://github-audit.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Fetches and distills a URL or raw HTML payload into compact, token-efficient agent-ready content using BM25-ranked budget control","exampleAgentPrompt":"Fetch https://stripe.com/docs/payments and distill it in budget mode focused on the query 'payment intents API', keeping it under 500 tokens so I can feed it cheaply into my pipeline.","exampleUseCases":[{"title":"Distill docs for agent context window","prompt":"Grab the OpenAI function calling docs at https://platform.openai.com/docs/guides/function-calling and distill them into structured markdown so I can drop them into my agent's context without burning tokens."},{"title":"BM25-ranked excerpt for RAG pipeline","prompt":"Pull https://www.ycombinator.com/library/4D-how-to-get-your-first-ten-customers and give me only the parts relevant to 'cold outreach strategies' in budget mode, capped at 300 tokens."},{"title":"Raw HTML cleanup for scraping workflow","prompt":"I have a big blob of raw HTML from a product page — distill it into a clean skeleton outline so my agent can navigate the page structure without processing thousands of tokens."}],"resultDescription":"Returns a JSON object containing distilled content (Markdown text, structured JSON tables/metadata, a skeleton outline, or a BM25-ranked excerpt depending on mode), an ROI proof object showing raw token count, distilled token count, tokens saved, compression ratio percentage, and estimated LLM cost saved in USD, plus optional cache hit/miss status and billing details.","failureModes":["URL unreachable or returns non-200 — endpoint may return an error status","HTML payload too large to process within service limits","Invalid mode enum value causes validation error","max_tokens set below minimum of 20 — rejected by schema validation","BM25 query provided without mode=budget — query may be ignored","Payment not completed via x402 — request blocked with HTTP 402","Idempotency-Key collision may return cached prior result unexpectedly"],"whenToPreferThis":"Choose this endpoint when you need to feed live web content or raw HTML into an LLM pipeline and want to minimize token usage via compression, structured extraction, or BM25-focused budget slicing. It is especially valuable when you have a strict token budget ceiling (max_tokens) and a specific focus query, or when you need ROI proof of how many tokens and dollars were saved. Prefer it over generic scrapers when you need the output to be directly agent-ready (Markdown, structured JSON, or skeleton) rather than raw text.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-23T00:37:06.168Z","isFirstParty":false,"canonicalSlug":"github-audit-agentdiet-dev-web-url-html-distiller-with-bm25-budget-c28b4a0f"}