{"uid":"cap_SOYcol4E6hBBgBZv_gEjZ","slug":"shopify-spy-agentdiet-dev-web-url-distillation-rag-chunker-d31203d6","name":"Web URL Distillation & RAG Chunker","description":"Distill a URL or raw HTML payload with BM25 budget control (Live x402 v2, IETF MPP & MCP endpoint at https://shopify-spy.agentdiet.dev/v1/rag-chunk)","url":"https://shopify-spy.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 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_wxT_CnJxVr2Drj2xdlQvN","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"shopify-spy.agentdiet.dev","brandSlug":"shopify-spy-agentdiet-dev-mpp","brandBaseUrl":"https://shopify-spy.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Fetches and compresses a webpage URL (or raw HTML) into compact, agent-ready tokens using BM25 budget control and multiple distillation modes","exampleAgentPrompt":"Distill https://docs.stripe.com/api into compact markdown tokens using budget mode, focused on 'payment intents', with a maximum of 500 tokens.","exampleUseCases":[{"title":"Compress docs before LLM context injection","prompt":"Grab the content at https://docs.stripe.com/api and distill it down to 800 tokens in budget mode, focused on 'webhooks', so I can feed it into my prompt without blowing the context window."},{"title":"Extract structured data from a product page","prompt":"Pull https://example-shop.com/product/widget and distill it in structured mode so I get the product metadata, pricing, and specs as clean JSON tables."},{"title":"Outline a long article for quick review","prompt":"Fetch https://techcrunch.com/2024/01/ai-roundup and give me a skeleton outline of the page so I can see its main sections at a glance."}],"resultDescription":"Returns a distilled version of the requested webpage in the chosen format (markdown, structured JSON, skeleton outline, or BM25-ranked budget excerpt), along with ROI metrics including raw token count, distilled token count, tokens saved, compression ratio percentage, and estimated LLM cost savings in USD. Also includes caching status and billing details.","failureModes":["Invalid or unreachable URL returns a fetch error","max_tokens below minimum (20) returns a validation error","mode=budget without a query may yield unfiltered output","Raw HTML too large may exceed processing limits","Payment failure via x402 blocks request execution","Cached responses may not reflect the latest version of the page"],"whenToPreferThis":"Choose this endpoint when you need to feed webpage content into an LLM but want to minimize token usage and cost. It is especially valuable for RAG pipelines, documentation ingestion, and agent workflows where fitting web content into a limited context window matters. The BM25 budget mode makes it superior to generic scrapers when you need relevance-ranked compression around a specific query. Prefer it over raw HTML fetchers when token efficiency and structured output are priorities.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:21:07.235Z","isFirstParty":false,"canonicalSlug":"shopify-spy-agentdiet-dev-web-url-distillation-rag-chunker-d31203d6"}