{"uid":"cap_rzGvcff6QaX55bF0RbxKd","slug":"agentdiet-context-window-guard-token-compression-endpoint-fdf67ad1","name":"AgentDiet Context Window Guard — Token Compression Endpoint","description":"Deterministic B2A/A2A/MCP/x402/MPP/L402 execution and intelligence node at https://status.agentdiet.dev settling in USDC on Base.","url":"https://status.agentdiet.dev/v1/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_B-B7mAv3muVVfdTABAhjn","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 distills AI context windows by removing bloat, reducing token count by up to 91% while preserving essential information","exampleAgentPrompt":"Take this long document I've been accumulating in my context window and run it through AgentDiet's guard endpoint to compress it — I want to see the compression ratio and get back the distilled version so I can save tokens on my next LLM call.","exampleUseCases":[{"title":"LLM cost reduction for long chats","prompt":"My conversation history is getting huge and my LLM calls are getting expensive — can you compress the full chat context through AgentDiet and tell me how much token reduction I'm getting back?"},{"title":"Agent memory pruning before tool call","prompt":"Before I send this accumulated agent scratchpad to the next step in my pipeline, run it through AgentDiet's compression guard and give me the slimmed-down version along with the compression percentage."},{"title":"Fitting RAG chunks into context limit","prompt":"I've got a batch of retrieved documents that's too large to fit in my 8k context window — use AgentDiet to distill and compress this text so it fits without losing the key information."}],"resultDescription":"Returns a JSON object with status 'ok', a compressed/distilled version of the input text in the 'data' field, and an 'roi_proof' object containing the compression_ratio_pct (e.g. 91.4%), demonstrating how much the token footprint was reduced.","failureModes":["Missing required 'input' or 'method' field returns validation error","Text input that is already minimal may yield low compression ratio","Payment not settled in USDC on Base causes 402 payment required response","Malformed query parameters result in schema validation failure","Empty text input may return empty data with 0% compression"],"whenToPreferThis":"Choose this endpoint when an AI agent or pipeline needs to reduce token usage before calling an expensive LLM, when a context window is approaching its limit and pruning is needed, or when you want a deterministic compression pass with a measurable ROI proof rather than a lossy summarization. Particularly useful in A2A and MCP pipelines where context accumulates across many steps.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-22T12:43:22.588Z","isFirstParty":false,"canonicalSlug":"agentdiet-context-window-guard-token-compression-endpoint-fdf67ad1"}