{"uid":"cap_yvE07cdyeJapqOn4RHSaw","slug":"json-repair-agentdiet-dev-web-url-to-agent-ready-token-distiller-rag-adf034f6","name":"Web URL to Agent-Ready Token Distiller (RAG Token Diet)","description":"Distill a URL or raw HTML payload with BM25 budget control (Live x402 v2, IETF MPP & MCP endpoint at https://json-repair.agentdiet.dev/v1/rag-token-diet)","url":"https://json-repair.agentdiet.dev/v1/rag-token-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_vdpQPhJ_KfgEz_w98ITCA","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"json-repair.agentdiet.dev","brandSlug":"json-repair-agentdiet-dev-mpp","brandBaseUrl":"https://json-repair.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Fetches and compresses a URL or raw HTML into compact, token-efficient content using BM25-based budget control and multiple extraction modes","exampleAgentPrompt":"Fetch the page at https://stripe.com/docs/payments and distill it into markdown, keeping it under 800 tokens focused on the topic of payment intents.","exampleUseCases":[{"title":"RAG pipeline web page ingestion","prompt":"Pull the content from https://openai.com/research/gpt-4 and distill it into compact markdown so I can feed it into my RAG system without exceeding my context window."},{"title":"Budget-capped research on a topic","prompt":"Get the page at https://docs.anthropic.com/en/api/getting-started and return only the parts relevant to 'rate limits', capped at 300 tokens — use budget mode."},{"title":"Structured data extraction from HTML","prompt":"I have this raw HTML from a product listing page — distill it into structured JSON tables showing the product names, prices, and descriptions."}],"resultDescription":"Returns a JSON object with: distilled content (Markdown, structured JSON, skeleton outline, or BM25-focused excerpt) under the 'data' key; ROI proof metrics including raw_tokens, distilled_tokens, tokens_saved, compression_ratio_pct, and llm_cost_saved_usd; cache status (HIT/MISS); billing info; and an overall status field.","failureModes":["URL is unreachable or returns non-200 HTTP status — endpoint may return an error status","URL content is too large and cannot be fetched within service limits","mode=budget requires a query parameter — missing query may cause degraded or default behavior","max_tokens below minimum of 20 returns a validation error","Raw HTML input too large may exceed processing limits","Payment not processed (x402) results in 402 response blocking the call"],"whenToPreferThis":"Choose this endpoint when you need to feed live web content into an LLM or RAG pipeline and want to minimize token usage and cost. It is ideal when you have a URL (or raw HTML) and need to control output length precisely via BM25 budget mode, or when you want structured extraction modes (markdown, structured, skeleton) rather than raw scraping. Prefer it over generic web scrapers when token economy and LLM-readiness are primary concerns.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-22T07:49:44.683Z","isFirstParty":false,"canonicalSlug":"json-repair-agentdiet-dev-web-url-to-agent-ready-token-distiller-rag-adf034f6"}