{"uid":"cap_4xOqV0ixy21W923rHdOZd","slug":"agentdiet-prompt-compress-context-window-token-reducer-f273038d","name":"AgentDiet Prompt Compress — Context Window Token Reducer","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-compress?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_GhCi2TMchJnl9H9urTt5a","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 a URL's content by stripping token bloat, reducing context window usage by up to 91% before passing it to an LLM","exampleAgentPrompt":"Compress the content at https://example.com/long-article using AgentDiet's prompt-compress so it fits in my context window — use GET mode and give me the compression ratio too.","exampleUseCases":[{"title":"Shrink news article for LLM summarization","prompt":"That article at https://techcrunch.com/2024/01/some-long-piece is too big for my context window — can you run it through AgentDiet's prompt-compress to strip the bloat so I can summarize it without hitting token limits?"},{"title":"RAG pipeline context cost reduction","prompt":"Before I index this documentation page at https://docs.myproduct.com/reference/api, compress it with AgentDiet so I'm only storing the meaningful tokens — I want to see the compression ratio it achieves."},{"title":"Fit competitor page into agent prompt","prompt":"I need to analyze https://competitor.com/pricing but the page is huge — use AgentDiet to compress it down so the whole thing fits in a single prompt without losing the important content."}],"resultDescription":"Returns a JSON object with a 'data' field containing the compressed content, a 'status' field ('ok' on success), and a 'roi_proof' object showing the compression_ratio_pct achieved (e.g. 91.4%).","failureModes":["URL unreachable or invalid — likely returns an error status instead of 'ok'","URL points to non-HTML binary content that cannot be compressed meaningfully","Missing required 'input' fields (type or method) — schema validation error","Rate limiting or payment failure via x402/USDC settlement on Base","Content behind authentication walls that the service cannot access"],"whenToPreferThis":"Choose this endpoint when an AI agent needs to process a web URL whose content is too large to fit efficiently in an LLM context window, and you want deterministic token reduction (up to 91%) paid per-call at $0.001 USDC. Prefer it over generic scrapers when token economy is the primary concern and you need a compression ratio proof returned alongside the content.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-22T12:43:10.848Z","isFirstParty":false,"canonicalSlug":"agentdiet-prompt-compress-context-window-token-reducer-f273038d"}