{"uid":"cap_d40sEC3BwWj6ER2qRrrFV","slug":"workflows-agentdiet-dev-agentdiet-web-distillation-api-72b16107","name":"AgentDiet Web Distillation API","description":"Distill a URL or raw HTML payload with BM25 budget control (Live x402 v2, IETF MPP & MCP endpoint at https://workflows.agentdiet.dev/api/diet)","url":"https://workflows.agentdiet.dev/api/diet?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_lTRW_9iRzNVeRdkxaooaf","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"workflows.agentdiet.dev","brandSlug":"workflows-agentdiet-dev-mpp","brandBaseUrl":"https://workflows.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Fetches a URL or raw HTML and distills it into compact, agent-ready tokens using BM25-powered budget control and multiple extraction modes","exampleAgentPrompt":"Can you distill https://stripe.com/docs/api into compact markdown — and keep it under 1000 tokens, focused on the topic 'payment intents'?","exampleUseCases":[{"title":"Token-budget research for LLM pipeline","prompt":"Fetch https://openai.com/research/gpt-4 and distill it into at most 500 tokens using BM25, focused on the query 'model capabilities and benchmarks' — I want to feed it to my agent without blowing up my context window."},{"title":"Structured data extraction from docs page","prompt":"Pull https://docs.github.com/en/rest/repos/repos and return the content in structured mode so I get clean JSON tables and metadata rather than raw HTML."},{"title":"Skeleton outline of a long article","prompt":"Take https://en.wikipedia.org/wiki/Large_language_model and give me just the skeleton outline — headings and subheadings — so my agent can navigate the structure without loading the full page."}],"resultDescription":"Returns a JSON object with a 'data' field containing the distilled content (Markdown, structured JSON, skeleton outline, or BM25 excerpt depending on mode), an 'roi_proof' object showing raw token count, distilled token count, tokens saved, compression ratio percentage, and estimated LLM cost saved in USD, plus optional cache hit/miss status and billing details.","failureModes":["URL is unreachable or returns non-200 status — endpoint may return an error status","HTML payload too large to process within service limits","Invalid mode enum value causes parameter rejection","max_tokens set below minimum of 20 returns validation error","BM25 query provided without mode=budget may be ignored or produce unexpected output","Payment not settled via x402 results in HTTP 402 response blocking access"],"whenToPreferThis":"Choose this endpoint when an AI agent needs to read a webpage but must stay within a token budget, minimize LLM costs, or receive structured/outline content rather than raw HTML. It is especially well-suited for agentic pipelines that need to feed web content into LLMs cost-efficiently, with built-in ROI tracking. Prefer it over generic scrapers when BM25-focused relevance filtering or multiple distillation modes (markdown, structured, skeleton, budget) are needed.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:26:25.906Z","isFirstParty":false,"canonicalSlug":"workflows-agentdiet-dev-agentdiet-web-distillation-api-72b16107"}