{"slug": "i-built-a-tool-that-cuts-anthropic-api-costs-by-67-and-it-finds-the-waste-before", "title": "I built a tool that cuts Anthropic API costs by 67% and it finds the waste before you spend", "summary": "A developer built token-saver, a tool that reduces Anthropic API costs by up to 67% by identifying waste before requests are sent. The tool includes a static analyzer, token counter, semantic compressor, and usage tracking, achieving significant token reductions in benchmarks for chatbots, RAG pipelines, and batch classifiers.", "body_md": "I was building AI apps on top of Anthropic's API and kept hitting the same problem: costs were higher than expected, and I had no idea where the waste was coming from.\n\nMost monitoring tools tell you what you already spent. I wanted something that tells you what you are about to waste before the request is sent.\n\nSo I built token-saver.\n\nWhat it does\n\nFour things, in order of when they help you:\n\n- Static Analyzer — scans your Python source code before you run it\ntsave scan chatbot.py\nIt finds patterns like API calls inside loops, uncached system prompts, full documents passed on every request, expensive models used for simple tasks. No API key needed. It reads your code like a linter reads style.\n- Token Counter + Cost Estimator — uses the official Anthropic count_tokens API, not tiktoken (which undercounts Claude tokens by 15-20%)\n- Semantic Compressor — doesn't just truncate. Scores each message by relevance to the current task, keeps the recent context intact, summarizes the rest. Result: 67% token reduction on real conversations.\n- Usage Tracking — every call tracked, monthly projections included.\n\nReal benchmark\n\nScenarioBeforeAfterReductionMulti-turn chatbot (50 turns)12,400 tokens4,100 tokens66.9%RAG pipeline18,200 tokens5,600 tokens69.2%Batch classifier8,500 tokens2,800 tokens67.1%\n\nAt 1,000 requests/day on Sonnet 4.6, that is roughly $200-$400/month saved.", "url": "https://wpnews.pro/news/i-built-a-tool-that-cuts-anthropic-api-costs-by-67-and-it-finds-the-waste-before", "canonical_source": "https://dev.to/remo12262/i-built-a-tool-that-cuts-anthropic-api-costs-by-67-and-it-finds-the-waste-before-you-spend-3oe7", "published_at": "2026-06-24 08:25:31+00:00", "updated_at": "2026-06-24 08:43:45.351476+00:00", "lang": "en", "topics": ["developer-tools", "large-language-models", "ai-products"], "entities": ["Anthropic", "token-saver", "Sonnet"], "alternates": {"html": "https://wpnews.pro/news/i-built-a-tool-that-cuts-anthropic-api-costs-by-67-and-it-finds-the-waste-before", "markdown": "https://wpnews.pro/news/i-built-a-tool-that-cuts-anthropic-api-costs-by-67-and-it-finds-the-waste-before.md", "text": "https://wpnews.pro/news/i-built-a-tool-that-cuts-anthropic-api-costs-by-67-and-it-finds-the-waste-before.txt", "jsonld": "https://wpnews.pro/news/i-built-a-tool-that-cuts-anthropic-api-costs-by-67-and-it-finds-the-waste-before.jsonld"}}