cd /news/developer-tools/i-built-a-tool-that-cuts-anthropic-a… · home topics developer-tools article
[ARTICLE · art-37462] src=dev.to ↗ pub= topic=developer-tools verified=true sentiment=↑ positive

I built a tool that cuts Anthropic API costs by 67% and it finds the waste before you spend

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.

read1 min views1 publishedJun 24, 2026

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.

Most 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.

So I built token-saver.

What it does

Four things, in order of when they help you:

  • Static Analyzer — scans your Python source code before you run it tsave scan chatbot.py It 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.
  • Token Counter + Cost Estimator — uses the official Anthropic count_tokens API, not tiktoken (which undercounts Claude tokens by 15-20%)
  • 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.
  • Usage Tracking — every call tracked, monthly projections included.

Real benchmark

ScenarioBeforeAfterReductionMulti-turn chatbot (50 turns)12,400 tokens4,100 tokens66.9%RAG pipeline18,200 tokens5,600 tokens69.2%Batch classifier8,500 tokens2,800 tokens67.1%

At 1,000 requests/day on Sonnet 4.6, that is roughly $200-$400/month saved.

── more in #developer-tools 4 stories · sorted by recency
── more on @anthropic 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/i-built-a-tool-that-…] indexed:0 read:1min 2026-06-24 ·