{"uid":"cap_2BHLkIKf0TMvt9wZSr6ad","slug":"prompt-guard-agentdiet-dev-webpage-distiller-compact-agent-ready-6337bc00","name":"Webpage Distiller – Compact Agent-Ready Token Extraction","description":"Distill a URL or raw HTML payload with BM25 budget control (Live x402 v2, IETF MPP & MCP endpoint at https://prompt-guard.agentdiet.dev/v1/webpage-distiller)","url":"https://prompt-guard.agentdiet.dev/v1/webpage-distiller?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_e37cruNb-rdRG6q5MewYv","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"prompt-guard.agentdiet.dev","brandSlug":"prompt-guard-agentdiet-dev-mpp","brandBaseUrl":"https://prompt-guard.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Fetches a URL or accepts raw HTML and compresses it into a compact, agent-readable format using BM25 budget control and multiple distillation modes.","exampleAgentPrompt":"Distill the Stripe docs page at https://stripe.com/docs/api into clean markdown, keeping it under 800 tokens and focusing on authentication.","exampleUseCases":[{"title":"Token-budget summarization of documentation","prompt":"Fetch the OpenAI API reference at https://platform.openai.com/docs/api-reference and distill it in budget mode focused on 'rate limits', keeping it under 500 tokens so I can paste it into my prompt."},{"title":"Structured data extraction from a landing page","prompt":"Pull https://example-saas.com/pricing and extract it in structured mode so I get the pricing tables and metadata as clean JSON I can reason over."},{"title":"Skeleton outline of a long article","prompt":"Give me a skeleton outline of the article at https://www.nytimes.com/2024/01/10/technology/ai-agents.html so I can see the section headers and main points without reading the full text."}],"resultDescription":"Returns a 'data' object containing the distilled content (Markdown text, structured JSON, skeleton outline, or BM25-ranked excerpt depending on mode), plus an 'roi_proof' object showing raw token count, distilled token count, tokens saved, compression ratio percentage, and estimated LLM cost saved in USD. Optionally includes cache hit/miss status and billing details.","failureModes":["Invalid or unreachable URL returns an error status","max_tokens below minimum (20) rejected with validation error","BM25 query ignored if mode is not 'budget'","Raw HTML too large may be truncated or timeout","Paywalled or JavaScript-heavy pages may yield poor distillation quality","Payment (x402) failure if agent lacks sufficient USDC balance"],"whenToPreferThis":"Choose this endpoint when an AI agent needs to read web pages but wants to minimize token consumption and LLM cost. It is especially useful in agentic pipelines where multiple URLs need to be processed, documentation pages need to be injected into prompts under a strict context window, or only the most query-relevant content (via BM25) is needed. Prefer it over raw fetch + parse approaches when compression ratio and cost savings matter.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:25:54.952Z","isFirstParty":false,"canonicalSlug":"prompt-guard-agentdiet-dev-webpage-distiller-compact-agent-ready-6337bc00"}