{"uid":"cap_m-he2DlpYCKwJuUs7vKtw","slug":"arxiv-digest-agentdiet-dev-distill-url-or-html-with-bm25-budget-control-8a0bc9af","name":"Distill URL or HTML 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://arxiv-digest.agentdiet.dev/v1/prompt-compress)","url":"https://arxiv-digest.agentdiet.dev/v1/prompt-compress?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_5dAo2HG29bjFaYOPhsdjv","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"arxiv-digest.agentdiet.dev","brandSlug":"arxiv-digest-agentdiet-dev-mpp","brandBaseUrl":"https://arxiv-digest.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Fetches and compresses a URL or raw HTML payload into clean Markdown, structured data, or a BM25-ranked token-budget excerpt","exampleAgentPrompt":"Distill https://arxiv.org/abs/2401.00001 into clean markdown focused on the methodology section, keeping it under 800 tokens using budget mode with the query 'training methodology'.","exampleUseCases":[{"title":"Fit research paper into LLM context","prompt":"Pull this arxiv paper at https://arxiv.org/abs/2310.06825 and compress it to under 500 tokens in budget mode, focused on the results and conclusions — I need to fit it inside my prompt without blowing the context window."},{"title":"Convert documentation page to structured data","prompt":"Grab the Stripe docs page at https://stripe.com/docs/api/charges and distill it into structured JSON tables showing all the API parameters and their types."},{"title":"Summarize competitor landing page","prompt":"Fetch https://openai.com/pricing and distill it into clean markdown so I can see the key pricing tiers and limits without all the HTML noise."}],"resultDescription":"Returns a 'data' object containing the distilled content (Markdown text, structured JSON tables/metadata, a skeleton outline, or a BM25-ranked excerpt depending on mode), plus an roi_proof block showing raw_tokens, distilled_tokens, tokens_saved, compression_ratio_pct, roi_multiplier, and llm_cost_saved_usd. Also includes cache hit/miss status and billing details.","failureModes":["URL is unreachable or returns non-200 — distillation cannot proceed","HTML payload is empty or malformed — returns error status","max_tokens set below minimum of 20 — rejected with validation error","BM25 query missing when mode=budget — may return unfiltered or error","Payment not provided or insufficient — HTTP 402 returned","Target site blocks crawlers — fetch may return empty or partial content"],"whenToPreferThis":"Choose this endpoint when you need to compress web content to fit within an LLM context window, especially when you want BM25-ranked relevance filtering against a specific query topic. It is preferable to generic scrapers when token cost reduction and ROI measurement are priorities, or when you need multiple distillation modes (markdown, structured, skeleton, budget) from a single service. Ideal for agentic pipelines that must stay within strict token budgets while processing arbitrary URLs or raw HTML.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-21T00:37:22.247Z","isFirstParty":false,"canonicalSlug":"arxiv-digest-agentdiet-dev-distill-url-or-html-with-bm25-budget-control-8a0bc9af"}