{"uid":"cap_cgqrt6uUvXe9woVh7asfY","slug":"agentdiet-clean-html-context-window-html-distiller-8804711e","name":"AgentDiet Clean HTML — Context Window HTML Distiller","description":"Deterministic B2A/A2A/MCP/x402/MPP/L402 execution and intelligence node at https://rag-diet.agentdiet.dev settling in USDC on Base.","url":"https://rag-diet.agentdiet.dev/v1/clean-html?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET","POST"],"type":"string"},"queryParams":{"type":"object","properties":{"url":{"type":"string"},"mode":{"type":"string"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":{"type":"json","example":{"data":{},"status":"ok","roi_proof":{"compression_ratio_pct":91.4}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","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":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_J5qhfzpgkoBNIFDDgmmz-","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Fetches a URL and strips HTML down to clean, token-efficient content, achieving up to 91%+ compression ratio for AI context windows","exampleAgentPrompt":"Can you clean and distill the HTML from https://example.com/article so I get only the essential text content with minimal tokens — I need to fit it into my context window without all the boilerplate noise?","exampleUseCases":[{"title":"RAG pipeline webpage ingestion","prompt":"Fetch and clean the HTML from https://docs.openai.com/overview so I can ingest just the meaningful content into my RAG system without wasting tokens on nav bars, scripts, and footers."},{"title":"Cost-efficient LLM web research","prompt":"I need to process about 20 web pages through GPT-4, but raw HTML is way too expensive. Can you use AgentDiet to strip and compress each page's HTML before I send it to the model — starting with https://techcrunch.com/2024/01/15/ai-funding-roundup?"},{"title":"Agent context window budget management","prompt":"My agent is hitting context limits when reading webpages. Clean the HTML from https://en.wikipedia.org/wiki/Transformer_(deep_learning_architecture) and give me the compression ratio so I can see how many tokens I'm saving."}],"resultDescription":"Returns a JSON object with a 'data' field containing the cleaned, distilled HTML/text content, a 'status' field ('ok'), and an 'roi_proof' object showing the compression_ratio_pct (e.g. 91.4%) achieved by the distillation — quantifying token savings.","failureModes":["Invalid or unreachable URL returns an error status","URL that blocks bot/scraper access may return empty or error","Very large pages may timeout or return partial content","Malformed input schema (missing 'type' or 'method') returns validation error","Pages behind authentication walls cannot be fetched","Network errors reaching the target URL result in failed status"],"whenToPreferThis":"Choose this endpoint when you need to reduce the token footprint of HTML web content before injecting it into an LLM context window — especially for RAG pipelines, multi-page research workflows, or cost-constrained agent loops where raw HTML would exceed limits or inflate costs. Prefer it over raw HTTP fetchers when token compression is the primary goal, and over generic web scrapers when you need a quantified ROI proof of compression. Best suited for single-URL, on-demand distillation via x402 micropayment at $0.001 USDC per call.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-22T12:44:50.628Z","isFirstParty":false,"canonicalSlug":"agentdiet-clean-html-context-window-html-distiller-8804711e"}