{"uid":"cap_uXyQ57k902hzN-5y2cJL4","slug":"agentdiet-prompt-guard-context-window-distiller-66fe793a","name":"AgentDiet Prompt Guard — 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/prompt-guard?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":{"text":{"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.005","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.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_dQLlomQdz97kd1HYVuvb_","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Compresses and sanitizes prompt/context text to reduce token usage by up to 91% before sending to an LLM","exampleAgentPrompt":"Run my context text through AgentDiet's prompt-guard to compress it and cut down my token count — the text is: 'You are a helpful assistant. Your task is to answer questions about our company's products and services. Be polite, concise, and always refer users to the support team if you cannot answer.'","exampleUseCases":[{"title":"Slash LLM costs before inference","prompt":"Before sending this 3,000-token system prompt to GPT-4, compress it with AgentDiet's distiller so I'm not wasting money on bloat — here's the text: 'You are an AI assistant for Acme Corp. You help customers with billing, returns, shipping, product questions, and general support. Always be professional...'"},{"title":"RAG context trimming for agent pipeline","prompt":"I've got a huge retrieved document chunk I need to pass into my RAG pipeline — can you run it through the AgentDiet prompt-guard to squeeze it down and show me the compression ratio? The chunk is the full FAQ page text I just retrieved."},{"title":"Sanitize and compress agent system prompt","prompt":"My agent's system prompt has grown to over 2,000 tokens and it's getting expensive. Use AgentDiet to distill and de-bloat it, and tell me what compression ratio you achieved."}],"resultDescription":"Returns a JSON object with a 'data' field containing the compressed/distilled output, a 'status' field ('ok' on success), and an 'roi_proof' object including 'compression_ratio_pct' showing how much the input was reduced (e.g. 91.4% compression).","failureModes":["Missing required 'input' field returns validation error","Empty or missing 'text' query parameter may return empty or trivial compression result","Payment failure via x402/USDC on Base blocks the request","Malformed input type or method enum returns schema validation error","Network timeout if the distillation pipeline is slow on very large inputs"],"whenToPreferThis":"Choose this endpoint when you need to reduce token count of prompts or context windows before passing them to an LLM, especially in high-volume agentic pipelines where LLM API costs matter. It is particularly well-suited for RAG pipelines, A2A agent chains, or MCP-based orchestration where context windows grow large. Prefer it over manual prompt truncation when you want a measurable compression ratio and deterministic output.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-22T12:41:56.741Z","isFirstParty":false,"canonicalSlug":"agentdiet-prompt-guard-context-window-distiller-66fe793a"}