GitHub

Cost Tracker

HTML5 JavaScript License PRs Welcome

Track LLM API spending across OpenRouter, OpenAI, and Anthropic — all in a single HTML file. No backend required.


✨ Features

  • 📊 Dashboard — Today / this week / this month / all-time cost summaries
  • 🔑 API Key Management — Store keys securely in localStorage (never leave your browser)
  • 🔄 Auto-Sync with OpenRouter — Fetch usage data directly from OpenRouter API
  • ✏️ Manual Entry — Log spend from any provider manually
  • 📈 Charts — Daily spend bar chart + provider pie chart (Canvas API, zero dependencies)
  • 📋 History — Full spend log with filtering by provider
  • 📥 CSV Export — Export all data for external analysis
  • 🎨 Dark Theme — Pleasant dark UI with orange accent

🚀 Quick Start

git clone https://github.com/soumendrak/cost-tracker.git
cd cost-tracker
open index.html    # or double-click it

That's it. No npm install, no build step, no server.

🔧 Usage

  1. Go to API Keys tab → paste your OpenRouter / OpenAI / Anthropic keys
  2. For OpenRouter: click 🔄 Refresh OpenRouter on the Dashboard to auto-import usage
  3. For other providers: use the Manual Entry tab
  4. View charts and history to track your burn rate

📁 Project Structure

cost-tracker/
├── index.html      # The entire app — open in any browser
├── logo.svg        # App logo
├── LICENSE         # MIT
└── README.md       # You are here

🏗 Architecture

Single-file vanilla HTML/CSS/JS. Charts drawn with Canvas API. Data persisted in localStorage. No frameworks, no CDNs, no build tools. Works offline after first load.

🤝 Contributing

PRs welcome! Keep the zero-dependency constraint — everything must work from a single index.html file.

📄 License

MIT © 2026 Soumendra

Read the original on github.com ↗