AI Spend Monitoring
Track Anthropic API usage and costs against daily/monthly thresholds with automated alerts.
Overview
AI agents monitor Anthropic API spend in real time, comparing daily and monthly usage against budget thresholds. When spend approaches 80% of daily or monthly limits, the system alerts leadership via Telegram and suggests throttling strategies.
How It Works
A Python script runs every 6 hours, calling the Anthropic admin API to pull message-level token usage and costs. It aggregates by day and month, compares against configured thresholds (low monthly cost), and sends alerts if limits are approaching. The script also tracks spending by agent and model.
Tools Used
Outcome
Prevented 2 instances of budget overrun by flagging high-spend days early. Identified that Opus 4-6 usage during research sprints was the primary cost driver, prompting a model mix optimization.