What problem does it solve?
It prevents unexpected AI runaways by tracking cross-provider spend, projecting end-of-month cost, alerting on anomalies, and enforcing circuit-breaker behavior when burn rate threatens the budget.
Core Features & Use Cases
- Spend tracking across providers: Monitors Anthropic, OpenAI, Google, and optionally OpenRouter using provider usage endpoints and local session/log files.
- Budget projection and alert tiers: Computes today/month/projected spend and raises Notice/Warn/Critical alerts based on trailing averages and budget thresholds.
- Safety circuit breakers for agent loops: Blocks starting new agent sessions in critical territory and can SIGTERM long-running processes when burn rate spikes during an active session.
- Operational guardrails with cost-saving guidance: Recommends prompt caching, Batch API usage, model routing heuristics, and local fallback routing when spend is high.
Quick Start
Use ai-spend-tripwire before starting a long agentic session or when you ask how much you have spent so it can track current spend, project month-end cost, and stop risky loops if needed.