AICostTracker v0.1.2 adds one-line auto-logging for OpenAI and Anthropic API calls
A new open-source tool called AICostTracker now offers a track() function that automatically logs every OpenAI or Anthropic API call without requiring changes to existing code. Developers simply wrap their AI client with track() and assign a project tag, after which token usage and costs are recorded silently in the background. The wrapper intercepts API responses to extract usage data, adds zero latency, and suppresses any logging errors so that API calls are never disrupted. Running aicost summary then displays a breakdown of total spend, token counts, and costs grouped by project and model. The tool is available as an npm package under @ozperium/aicost-tracker, with source code published on GitHub.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in