{"uid":"cap_yG6SsjlDwEXqFrILmtGpn","slug":"serp-extract-agentdiet-dev-web-url-distillation-rag-chunking-api-b4505915","name":"Web URL Distillation & RAG Chunking API","description":"Distill a web URL into compact agent-ready tokens (Live x402 v2, IETF MPP & MCP endpoint at https://serp-extract.agentdiet.dev/v1/rag-chunk)","url":"https://serp-extract.agentdiet.dev/v1/rag-chunk?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_cX3pAPV1As8L67kHe1nRd","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"serp-extract.agentdiet.dev","brandSlug":"serp-extract-agentdiet-dev-mpp","brandBaseUrl":"https://serp-extract.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Fetches and compresses a web URL or raw HTML into compact, agent-ready tokens using BM25 budget control and multiple distillation modes","exampleAgentPrompt":"Can you distill https://stripe.com/docs/payments into clean markdown and keep it under 800 tokens, focused on payment intent creation?","exampleUseCases":[{"title":"RAG pipeline web content ingestion","prompt":"Fetch and compress https://openai.com/research/gpt-4 into structured markdown for me — I want to add it to my RAG knowledge base without wasting tokens."},{"title":"Budget-capped topic-focused extraction","prompt":"Pull the content from https://docs.anthropic.com/claude/reference and give me only the parts about tool use, capped at 500 tokens using BM25 focus."},{"title":"Raw HTML cleanup for agent processing","prompt":"I have raw HTML from a scraped product page — can you distill it into a clean skeleton outline so my agent can parse the structure without all the noise?"}],"resultDescription":"Returns a JSON object containing distilled content in the requested format (Markdown, structured JSON tables/metadata, skeleton outline, or BM25-ranked budget excerpt), along with ROI proof metrics showing raw vs. distilled token counts, tokens saved, compression ratio, estimated LLM cost saved, and optional cache status and billing details.","failureModes":["Invalid or unreachable URL returns an error status","HTML payload too large or malformed may cause distillation failure","mode=budget without a query parameter may return unfiltered or degraded output","max_tokens below minimum (20) is rejected with a validation error","Rate limiting or payment failure (x402) blocks the request","Private or auth-gated URLs cannot be fetched and return access errors"],"whenToPreferThis":"Choose this endpoint when you need to reduce token consumption before feeding web content into an LLM, especially for RAG pipelines, agent grounding, or cost-sensitive workflows. It is especially useful when you need BM25-focused excerpts from long pages, want structured or skeleton output rather than raw HTML, or need a verifiable compression ROI. Prefer it over generic scrapers when token budget control and agent-readiness of the output are priorities.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T12:35:19.418Z","isFirstParty":false,"canonicalSlug":"serp-extract-agentdiet-dev-web-url-distillation-rag-chunking-api-b4505915"}