A Go application that tracks Claude Code and Cursor token usage and sends metrics to Prometheus. It can run in CLI mode (outputs today's token count) or daemon mode (system tray application with periodic metrics sending).
git clone https://github.com/ca-srg/tosage.gittosage monitors token consumption across Claude Code, Cursor, AWS Bedrock, and Google Vertex AI, integrating with Prometheus for centralized metrics collection. It operates in CLI mode for instant token counts or daemon mode with continuous monitoring and system tray integration. The tool automatically discovers Claude Code data, fetches Cursor API metrics, and pulls cloud AI service usage from AWS CloudWatch and Google Cloud Monitoring. Teams can visualize token consumption trends and multi-cloud AI costs using pre-configured Grafana dashboards. CSV export functionality enables historical analysis and reporting of token usage patterns.
Run the automated installation script (curl -fsSL https://raw.githubusercontent.com/ca-srg/tosage/main/scripts/install.sh | bash) for macOS, which guides you through Prometheus configuration. Alternatively, download pre-built binaries or build from source. Configure ~/.config/tosage/config.json with your Prometheus remote write URL and optional AWS Bedrock or Google Vertex AI credentials. Run in CLI mode for immediate token counts or daemon mode for continuous metrics sending.
Track token usage across multiple AI tools for cost accountability
Monitor team-wide AI consumption trends with Grafana dashboards
Aggregate metrics from Cursor, Claude Code, Bedrock, and Vertex AI in one system
Export historical token usage data for billing and cost analysis
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/ca-srg/tosageCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
I'm using Tosage to track my team's AI token usage. We need to monitor [COMPANY] across [INDUSTRY] platforms. Can you help me set up Tosage to track [PLATFORM1], [PLATFORM2], and [PLATFORM3]? What are the key metrics I should focus on for [SPECIFIC_USE_CASE]?
## Tosage Setup Guide for AI Token Monitoring
### Platforms to Track
- **Claude Code**: Primary platform for code generation
- **Cursor**: Used for document editing and formatting
- **AWS Bedrock**: Deployed for custom model training
### Key Metrics to Monitor
- **Token Count**: Daily and monthly usage
- **Cost Analysis**: Based on current pricing models
- **Usage Patterns**: Peak times and user distribution
### Recommended Configuration
```
# Example configuration for Tosage
platforms:
- name: Claude Code
api_key: your_api_key_here
interval: 3600
- name: Cursor
api_key: your_api_key_here
interval: 7200
- name: AWS Bedrock
api_key: your_api_key_here
interval: 14400
metrics:
- token_count
- cost_analysis
- usage_patterns
```
### Next Steps
1. Install Tosage on your local machine.
2. Configure the `config.yaml` file with your API keys.
3. Run Tosage in daemon mode for continuous monitoring.
4. Set up Prometheus to collect and visualize the metrics.AI assistant built for thoughtful, nuanced conversation
Open source metrics and monitoring for your systems and services
Accounting software with automated invoicing and reporting
Unlock data insights with interactive dashboards and collaborative analytics capabilities.
The AI Code Editor for productive developers
Fare payment for public transport
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan