{"uid":"cap_itGxuDPUpB3IJQmK6KzI7","slug":"domain-osint-agentdiet-dev-web-url-context-trimmer-distiller-ef2d03d7","name":"Web URL Context Trimmer & Distiller","description":"Distill a URL or raw HTML payload with BM25 budget control (Live x402 v2, IETF MPP & MCP endpoint at https://domain-osint.agentdiet.dev/v1/context-trimmer)","url":"https://domain-osint.agentdiet.dev/v1/context-trimmer?utm_source=zero.xyz","method":"GET","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_-bg0kxoOlfiLZXUm9Z8mY","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"domain-osint.agentdiet.dev","brandSlug":"domain-osint-agentdiet-dev-mpp","brandBaseUrl":"https://domain-osint.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Fetches a web URL (or accepts raw HTML) and distills it into compact, agent-ready tokens using BM25 budget control and multiple extraction modes","exampleAgentPrompt":"Distill the content at https://stripe.com/docs/payments into compact markdown, keeping it under 800 tokens so I can include it in my prompt without blowing my context window.","exampleUseCases":[{"title":"Fitting docs into LLM context window","prompt":"Grab the Stripe documentation page at https://stripe.com/docs/api and distill it into clean markdown under 500 tokens — I need to fit it into my agent's context without running out of space."},{"title":"BM25-focused research excerpt","prompt":"Fetch https://en.wikipedia.org/wiki/Transformer_(machine_learning_model) and give me only the most relevant passages about attention mechanisms, using budget mode with a max of 300 tokens."},{"title":"Structured data extraction from a webpage","prompt":"Pull the page at https://coinbase.com/institutional and distill it into structured JSON tables and metadata — I want to extract the key product names, features, and any pricing info from it."}],"resultDescription":"Returns a JSON object containing the distilled content (markdown, structured JSON, skeleton outline, or BM25 excerpt depending on mode), alongside ROI proof metrics (raw token count, distilled token count, tokens saved, compression ratio percentage, estimated LLM cost saved in USD), cache status (HIT/MISS with latency), and billing details.","failureModes":["Invalid or unreachable URL returns an error status","HTML fetch timeout for slow or blocked pages","Token budget too small (max_tokens below minimum of 20) returns validation error","BM25 query mode without a query parameter may return generic output","Payment failure via x402 returns 402 with payment required details","Rate limiting or access restrictions on target URL may yield incomplete content"],"whenToPreferThis":"Choose this endpoint when you need to compress web content into a strict token budget before passing it to an LLM, especially when LLM context costs are a concern. It is particularly valuable when you want BM25-focused excerpts (only the most relevant passages for a query) rather than full page content. Prefer it over generic scraping APIs when you need built-in compression ratio metrics, multiple output modes (markdown, structured, skeleton, budget), or when you want to quantify how much LLM cost you are saving from the compression.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:21:35.632Z","isFirstParty":false,"canonicalSlug":"domain-osint-agentdiet-dev-web-url-context-trimmer-distiller-ef2d03d7"}