{"uid":"cap_hXYKlE-1hyjAd_FUYj3rK","slug":"alpha-stream-agentdiet-dev-agentdiet-context-trimmer-web-url-26dbc6eb","name":"AgentDiet Context Trimmer – Web URL Distillation","description":"Distill a URL or raw HTML payload with BM25 budget control (Live x402 v2, IETF MPP & MCP endpoint at https://alpha-stream.agentdiet.dev/v1/context-trimmer)","url":"https://alpha-stream.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_Rpz3pH0E6iidoDCVx4Yhz","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"alpha-stream.agentdiet.dev","brandSlug":"alpha-stream-agentdiet-dev-mpp","brandBaseUrl":"https://alpha-stream.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Fetches a web URL (or accepts raw HTML) and compresses it into compact, agent-ready tokens using BM25 budget control and multiple distillation modes","exampleAgentPrompt":"Can you fetch the Stripe docs page at https://stripe.com/docs/api/charges and distill it into compact markdown, keeping it under 500 tokens and focusing on the 'create a charge' section?","exampleUseCases":[{"title":"Compress documentation page for agent context","prompt":"Grab the OpenAI API docs at https://platform.openai.com/docs/guides/embeddings and distill them into structured markdown so I can include them in my prompt without blowing my context window."},{"title":"Budget-trimmed research snippet with BM25 focus","prompt":"I need the most relevant 300 tokens from https://en.wikipedia.org/wiki/Retrieval-augmented_generation — use budget mode with the query 'vector database retrieval' so I get only the parts that matter."},{"title":"Quick skeleton outline of a long article","prompt":"Can you pull https://www.paulgraham.com/startupideas.html and give me just a skeleton outline of the sections so I can decide which parts to read in full?"}],"resultDescription":"Returns a 'data' object containing the distilled content in the requested format (markdown, structured JSON, skeleton outline, or BM25-focused excerpt), plus an 'roi_proof' object showing raw vs. distilled token counts, tokens saved, compression ratio percentage, ROI multiplier, and estimated LLM cost saved in USD. Also includes cache hit/miss status and optional billing metadata.","failureModes":["Invalid or unreachable URL returns a fetch error","mode=budget without a query or max_tokens may return unfiltered content","Very large HTML pages may exceed processing limits","Paywalled or JavaScript-rendered pages may return incomplete content","max_tokens below minimum of 20 triggers a validation error","Missing required 'url' parameter returns a 400-level error"],"whenToPreferThis":"Choose this endpoint when an AI agent needs to incorporate live web content into its context window without exhausting token budgets. It is ideal when working with long documentation pages, news articles, or raw HTML that must be compressed before being sent to an LLM. The BM25 budget mode is especially valuable when only a topically relevant excerpt is needed. Prefer this over generic scraping tools when token efficiency and LLM cost savings are explicit concerns, or when structured output (tables, skeleton, markdown) from web content is needed.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:19:25.317Z","isFirstParty":false,"canonicalSlug":"alpha-stream-agentdiet-dev-agentdiet-context-trimmer-web-url-26dbc6eb"}