{"uid":"cap_vklxnAdqKBsqh6ZXidm4q","slug":"agentdiet-rag-token-diet-url-content-compression-retrieval-78209e2f","name":"AgentDiet RAG Token Diet – URL Content Compression & Retrieval","description":"Deterministic B2A/A2A/MCP/x402/MPP/L402 execution and intelligence node at https://mcp-gateway.agentdiet.dev settling in USDC on Base.","url":"https://mcp-gateway.agentdiet.dev/v1/rag-token-diet?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET","POST"],"type":"string"},"queryParams":{"type":"object","properties":{"url":{"type":"string"},"mode":{"type":"string"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":{"type":"json","example":{"data":{},"status":"ok","roi_proof":{"compression_ratio_pct":91.4}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","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":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_GKRfNiC4fUbTv6d7NrB_t","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Fetches a URL and returns a semantically compressed, token-efficient summary of its content with a compression ratio proof for RAG pipelines.","exampleAgentPrompt":"Fetch https://example.com/article and compress it into a token-efficient format using the RAG token diet endpoint so I can store the semantic content without burning tokens.","exampleUseCases":[{"title":"RAG pipeline token cost reduction","prompt":"I need to pull in this research article at https://arxiv.org/abs/2401.00001 and compress it down to its semantic core before I embed it — can you run it through the token diet so I save on embedding costs?"},{"title":"Agent memory pre-processing","prompt":"Before storing this webpage https://docs.stripe.com/api into my agent's long-term memory, compress its content so it takes up fewer tokens and I get a compression ratio report back."},{"title":"Cheap web context injection","prompt":"I want to inject context from https://news.ycombinator.com into my prompt but I'm worried about token limits — can you fetch that URL and give me the token-diet compressed version with the ROI proof?"}],"resultDescription":"Returns a JSON object with a `data` field containing the compressed semantic content of the fetched URL, a `status` field confirming success, and a `roi_proof` object showing the `compression_ratio_pct` (e.g. 91.4%) achieved versus the raw content.","failureModes":["Invalid or unreachable URL returns an error status","Missing required `input` field causes schema validation failure","Unsupported HTTP method (not GET or POST) is rejected by enum constraint","Payment failure (x402 USDC settlement) blocks the request before execution","Target URL returns non-200 response, resulting in empty or error data field","Rate limiting or gateway timeout for slow-loading target pages"],"whenToPreferThis":"Choose this endpoint when you need to fetch web content and dramatically reduce its token footprint before embedding, storing in a vector DB, or injecting into a prompt. It is especially useful in RAG pipelines where token costs matter and you want a provable compression ratio. Prefer it over raw web fetching when you need a lightweight, agent-optimized representation rather than full HTML.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-22T12:43:59.948Z","isFirstParty":false,"canonicalSlug":"agentdiet-rag-token-diet-url-content-compression-retrieval-78209e2f"}