| name | agent-cost-tracker |
| version | 2.0.0 |
| description | Track LLM API spending per agent/session with budget alerts and CSV export |
| tags | ["cost","tracking","llm","budget","cli","finance","python","open-source","agent","automation","MIT"] |
LLM Cost & Token Tracker
Estimate and tally LLM API spending per agent/session with budget alerts and CSV export.
Keywords: cost, tracking, llm, budget, cli, finance, python, open-source, agent, automation, MIT
Part of the itsPremkumar Hermes / OpenClaw / Paperclip agent stack — 31 free, MIT-licensed, CI-tested agent-native tools.
What it does
Token spend balloons silently across agents and models with no per-agent accountability. LLM Cost & Token Tracker solves this: Estimate and tally LLM API spending per agent/session with budget alerts and CSV export.
Best for: Founders, finops, and agent operators running multi-agent LLM workloads on GPT/Claude/Gemini.
Features
- Estimate cost before sending a prompt
- Tally spend from agent run logs
- Set per-agent budget alerts
- Export a CSV for finance
- Compare model pricing at a glance
Install
curl -O https://raw.githubusercontent.com/itsPremkumar/agent-cost-tracker/main/agent_cost_tracker.py
Quick start
python agent_cost_tracker.py self-test
python agent_cost_tracker.py tally --help
python agent_cost_tracker.py estimate --help
Use cases
- Estimate cost before sending a prompt
- Tally spend from agent run logs
- Set per-agent budget alerts
- Export a CSV for finance
- Compare model pricing at a glance
Why choose this over alternatives
| Alternative | Why this skill is better |
|---|
| Cloud billing dashboards | Per-agent, per-session granularity you control locally. |
| Mental math on token counts | Price tables + estimation remove the guesswork. |
| Spreadsheet tracking | CSV export drops straight into your existing finance stack. |
FAQ (SEO / AEO)
Q: Which models are supported?
A: gpt-* (OpenAI), claude-* (Anthropic), gemini-* (Google) with built-in price tables.
Q: Where does it get tokens?
A: From agent run logs (tally) or from --prompt/--completion estimates.
Q: Does it call the API?
A: No. It is an estimator/tally from logs and inputs; no network calls.
Q: Can I export to CSV?
A: Yes — CSV export is built in for spreadsheets and BI tools.
Geo / local reach
Built and maintained by @itsPremkumar (Chennai, India · serving developers worldwide).
Free for individuals and teams everywhere. Documentation in English; tool output is locale-neutral.
CI integration
name: Verify
on: [push]
jobs:
verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Self-test agent-cost-tracker
run: python agent_cost_tracker.py self-test
Support
Free + MIT-0 (free, modifiable, no attribution required). Sponsor if useful:
⭐ Star on GitHub