{"uid":"cap_I47XzUqJWYGmSUQRtQST_","slug":"alpha-stream-agentdiet-dev-agentdiet-rag-diet-web-distillation-api-56b81cb9","name":"AgentDiet RAG-Diet Web Distillation API","description":"Distill a web URL into compact agent-ready tokens (Live x402 v2, IETF MPP & MCP endpoint at https://alpha-stream.agentdiet.dev/v1/rag-diet)","url":"https://alpha-stream.agentdiet.dev/v1/rag-diet?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","minLength":1,"description":"Target webpage URL to distill (or builtin://stripe-docs)"},"mode":{"enum":["markdown","structured","skeleton","budget"],"type":"string","default":"markdown","description":"Extraction mode: markdown, structured, skeleton, or budget"},"limit":{"type":"integer","default":20,"maximum":100,"minimum":1,"description":"Maximum number of items to return per page (1-100)"},"query":{"type":"string","description":"BM25 focus query when mode=budget"},"cursor":{"type":"string","description":"Opaque pagination cursor for fetching the next page"},"max_tokens":{"type":"integer","minimum":20,"description":"Strict token 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_sTkeQrSOZrewJNycDOx6F","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 and distills it into compact, token-efficient agent-ready content using multiple extraction modes (markdown, structured, skeleton, or BM25-focused budget)","exampleAgentPrompt":"Distill https://docs.stripe.com/payments/quickstart into compact markdown and give me a token-efficient version I can use in my RAG pipeline — use budget mode with a max of 2000 tokens and focus the BM25 query on 'payment intents'.","exampleUseCases":[{"title":"Cheapening LLM context from docs","prompt":"Pull the Stripe docs from builtin://stripe-docs and distill them into skeleton mode so I can feed just the outline to my agent without blowing up the context window."},{"title":"Focused BM25 snippet for research agent","prompt":"Fetch https://en.wikipedia.org/wiki/Transformer_(machine_learning_model) in budget mode, cap it at 1500 tokens, and focus the extraction on 'attention mechanism' so I only get the relevant section."},{"title":"Structured table extraction from a product page","prompt":"Distill https://aws.amazon.com/ec2/pricing/ using structured mode so I get the pricing tables as clean JSON I can compare programmatically."}],"resultDescription":"Returns a distilled version of the target webpage in the requested format (markdown, structured JSON, skeleton outline, or BM25-focused budget excerpt), along with ROI proof metrics including raw token count, distilled token count, tokens saved, compression ratio percentage, estimated LLM cost saved in USD, and a ROI multiplier. Also includes optional cache status (HIT/MISS) and billing details.","failureModes":["Invalid or unreachable URL returns an error status","URL that blocks scraping bots may return empty or partial content","mode=budget without a query parameter may degrade focus quality","max_tokens set too low may truncate critical content","Cursor-based pagination with invalid cursor returns an error","Payment failure via x402 results in 402 response blocking execution","Rate limiting may occur under high request volumes"],"whenToPreferThis":"Choose this endpoint when you need to pass web page content to an LLM but want to minimize token consumption and cost — especially for RAG pipelines, documentation ingestion, or any agent workflow where raw HTML or full-page markdown would be prohibitively large. It is uniquely valuable when you need BM25-focused budget extraction to retrieve only the most query-relevant tokens from a page, or when you want structured JSON tables automatically extracted. Prefer it over generic scraping APIs when token efficiency and LLM cost reduction are explicit goals.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-23T06:34:07.463Z","isFirstParty":false,"canonicalSlug":"alpha-stream-agentdiet-dev-agentdiet-rag-diet-web-distillation-api-56b81cb9"}