{"uid":"cap_iR-XIZyOUoeuJAwqEGsWs","slug":"agentdiet-token-optimizer-db9016d7","name":"AgentDiet Token Optimizer","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/token-optimizer?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_UCr9P_8OkgdiRWV8aTNUv","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 AI context windows by stripping bloat from text or web content to reduce token usage by up to 85-91%","exampleAgentPrompt":"Can you use AgentDiet to compress the content at https://example.com/long-article using GET mode so I can fit it into my context window without blowing my token budget?","exampleUseCases":[{"title":"RAG pipeline token cost reduction","prompt":"Before I feed this URL into my RAG pipeline, run it through AgentDiet's token optimizer to strip out all the bloat — I want to see the compression ratio and get the distilled content back."},{"title":"Agent context window pre-processing","prompt":"My AI agent keeps hitting context limits when it reads news pages. Can you use AgentDiet to compress https://news.site/article via GET so the distilled version fits cleanly into my prompt?"},{"title":"LLM API cost minimization","prompt":"I'm spending too much on LLM calls because my inputs are too long. Use AgentDiet to optimize this URL's content and tell me what compression ratio I'm getting so I can estimate my savings."}],"resultDescription":"Returns a JSON object with a 'data' field containing the compressed/distilled content, a 'status' field (e.g. 'ok'), and a 'roi_proof' object showing the compression_ratio_pct (e.g. 91.4%) achieved by the optimizer.","failureModes":["Invalid or unreachable URL returns an error status","Missing required 'input' object with type and method causes schema validation failure","Unsupported mode parameter may result in default behavior or error","Network timeout if target URL is slow to respond","Payment failure via x402/USDC may block execution"],"whenToPreferThis":"Choose this endpoint when an AI agent or pipeline needs to reduce token consumption before LLM calls, especially for web-sourced content in RAG workflows. Ideal when working with long web pages or documents where 80-91% compression ratios are acceptable and cost reduction is a priority. Best suited for B2A or A2A workflows using x402 micropayment protocols on Base/USDC.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-22T12:44:32.343Z","isFirstParty":false,"canonicalSlug":"agentdiet-token-optimizer-db9016d7"}