{"uid":"cap_nPXPKU5DtVzq13Un_PW3c","slug":"agentdiet-x402-gateway-context-window-distiller-40f09079","name":"AgentDiet x402 Gateway — Context Window Distiller","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/x402-gateway?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":{"query":{"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.01","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.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_TZoU1RGDW4Yjwoj9eGJI1","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Compresses and distills AI context windows via a pay-per-call x402 gateway, reducing token usage by up to 85-91% while preserving semantic content.","exampleAgentPrompt":"Use AgentDiet to compress this large context window for me — I need to cut it down from its current size and get a compression ratio proof back so I can see how much token bloat was removed.","exampleUseCases":[{"title":"RAG result de-bloating before LLM call","prompt":"I'm pulling retrieval results for my agent and they're way too long — can you send them through AgentDiet's context distiller and trim the token count before passing them to the model?"},{"title":"Agent pipeline cost optimization","prompt":"My A2A pipeline keeps hitting token limits and my costs are spiking — run my agent's context through AgentDiet to compress it and show me the compression ratio so I can see how much I'm saving."},{"title":"MCP context window pruning","prompt":"Before my MCP node forwards this context to the next step, I want to strip all the redundant tokens out of it — use AgentDiet's distiller to compress it and give me back the lean version with the ROI proof."}],"resultDescription":"Returns a JSON object with a 'data' field containing the distilled/compressed content, a 'status' field ('ok' on success), and an 'roi_proof' object containing 'compression_ratio_pct' — e.g. 91.4 — showing how much token reduction was achieved.","failureModes":["Missing required 'input' field returns validation error","Invalid HTTP method enum value (not GET or POST) causes rejection","Payment failure on x402 gateway blocks execution","Empty or malformed query param returns no meaningful compression","Network timeout if upstream node is unavailable"],"whenToPreferThis":"Choose this endpoint when an AI agent or pipeline needs to reduce token consumption before calling an expensive LLM, when RAG retrieval results are oversized, or when operating under strict context window limits. Particularly suited for B2A/A2A workflows using x402 micropayments on Base/USDC where per-call billing is acceptable and deterministic compression with provable ROI is required.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-22T12:44:00.846Z","isFirstParty":false,"canonicalSlug":"agentdiet-x402-gateway-context-window-distiller-40f09079"}