{"uid":"cap_PJlH0SXimF6RSs4G11kWd","slug":"agentdiet-rag-token-diet-context-window-compressor-9b399aac","name":"AgentDiet RAG Token Diet — Context Window Compressor","description":"Deterministic B2A/A2A/MCP/x402/MPP/L402 execution and intelligence node at https://rag-diet.agentdiet.dev settling in USDC on Base.","url":"https://rag-diet.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_1qtuRkSFIWJPTxcByMtaZ","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":"Compresses and distills a URL's content into a token-efficient representation, reducing context window bloat by up to 91% for AI agents.","exampleAgentPrompt":"Can you use AgentDiet's RAG token diet to compress the content at https://example.com/long-article via a GET request so it fits in my context window more efficiently?","exampleUseCases":[{"title":"RAG pipeline context compression","prompt":"I need to feed this documentation page at https://docs.myproject.io/api-reference into my RAG pipeline but it's way too long — can you run it through the AgentDiet token diet compressor to shrink it down before indexing?"},{"title":"LLM cost reduction for web scraping","prompt":"I'm pulling in a bunch of web pages to summarize but the token costs are killing me — can you compress https://news.ycombinator.com using the AgentDiet context distiller so I only pass the essential content to the LLM?"},{"title":"Agent context window management","prompt":"My AI agent is hitting context window limits when reading https://en.wikipedia.org/wiki/Transformer_(deep_learning_architecture) — can you use AgentDiet's RAG diet endpoint to distill it down to the important bits using GET mode?"}],"resultDescription":"Returns a JSON object with a 'data' field containing the distilled/compressed content, a 'status' field confirming success, and an 'roi_proof' object showing the compression_ratio_pct (e.g. 91.4%) achieved — quantifying exactly how much token bloat was removed.","failureModes":["Invalid or unreachable URL returns an error status","Unsupported HTTP method (not GET or POST) causes rejection","Payment not settled in USDC on Base results in 402 response","Missing required 'input' object or 'type'/'method' fields returns validation error","Timeout if target URL is slow to respond","Very short or already-minimal content may yield low compression ratio"],"whenToPreferThis":"Choose this endpoint when an AI agent needs to ingest web content but faces context window constraints or high token costs — especially in RAG pipelines, multi-step agent workflows, or any scenario where raw HTML/text from a URL is too verbose. It is purpose-built for agent-to-agent (A2A) and machine-to-agent contexts, supports micropayment via x402/USDC on Base, and provides a quantified compression ratio as proof of ROI, making it ideal for cost-conscious automated pipelines.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-22T12:43:09.320Z","isFirstParty":false,"canonicalSlug":"agentdiet-rag-token-diet-context-window-compressor-9b399aac"}