AI Chat Billing System: interactive demo
The AI Chat Billing System is a proof-of-concept for tracking and billing AI chat thread interactions with real-time cost metrics and analytics. It addresses the challenge of monitoring and billing AI model usage in chat-based applications, where understanding cost is critical for business planning.
The proof-of-concept combines a React chat interface, a FastAPI backend and event collector, a Streamlit analytics dashboard, Kafka, Redis and SQLite. Its design includes token usage tracking, per-thread and per-message cost breakdowns, and invoices, with a 15-second analytics refresh target rather than a measured production guarantee.
This page is an interactive demo of those ideas. It uses clearly labelled synthetic data and runs entirely in your browser.
Features
- Simulated chat threads with token counts per message
- Editable per-model price table
- Metering pipeline view: ingest, aggregate, dashboard
- Cost by hour, thread and model with accessible tables
- Steady, spike and runaway-thread scenarios with a seed
- Invoice builder with CSV export and print view
All data is synthetic and the demo runs entirely in your browser; nothing is sent anywhere. Figures are not the project's real metrics.