Install
openclaw skills install @itspremkumar/agent-cost-trackerTrack LLM API spending per agent/session with budget alerts and CSV export
openclaw skills install @itspremkumar/agent-cost-trackerEstimate 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.
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.
# Requires Python 3.8+. No pip install needed.
curl -O https://raw.githubusercontent.com/itsPremkumar/agent-cost-tracker/main/agent_cost_tracker.py
# Or copy the file anywhere — it's self-contained.
python agent_cost_tracker.py self-test # prove it works end-to-end
python agent_cost_tracker.py tally --help # tally subcommand
python agent_cost_tracker.py estimate --help # estimate subcommand
| 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. |
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.
Built and maintained by @itsPremkumar (Chennai, India · serving developers worldwide). Free for individuals and teams everywhere. Documentation in English; tool output is locale-neutral.
# .github/workflows/verify.yml
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
Free + MIT-0 (free, modifiable, no attribution required). Sponsor if useful:
⭐ Star on GitHub