This chapter covers the core features and capabilities of LLM Cost Tracker.
# Run demo with simulated API calls
python src/llm_cost_tracker.py --demo
# Show pricing table
python src/llm_cost_tracker.py --pricing
# Log a request
python src/llm_cost_tracker.py --log '{"model":"gpt-4o","input_tokens":500,"output_tokens":200}'
# Check budget
python src/llm_cost_tracker.py --budget 50.00 --db costs.jsonl
# Generate usage report
python src/llm_cost_tracker.py --report --db costs.jsonl
# Forecast next 30 days
python src/llm_cost_tracker.py --forecast 30 --db costs.jsonlFollow this guide to get LLM Cost Tracker up and running in your environment.
llm-cost-tracker/
├── README.md
├── LICENSE
├── src/
│ └── llm_cost_tracker.py # Core engine (~420 lines)
└── examples/
├── basic_usage.py # Programmatic usage example
└── sample_costs.jsonl # Sample cost data
| Flag | Description |
|---|---|
--demo | Run demo with simulated data |
--pricing | Show pricing table |
--db FILE | Path to cost database (default: llm_costs.jsonl) |
--log JSON | Log a request with model, input_tokens, output_tokens |
--report | Generate usage report |
--days N | Limit report to last N days |
--budget USD | Check spending against budget |
--forecast DAYS | Forecast costs for N days |
--export FILE | Export report to JSON |
Get the full LLM Cost Tracker and unlock everything.
Get the complete guide with every chapter unlocked, including code samples, diagrams, and best practices.
Access all interactive tools with complete data, all workload profiles, and the full scenario library.
Downloadable source code, configuration files, and working examples from every chapter.
Free updates for life. Every new chapter, tool, and improvement included.