Help AI developers and small teams track every agent's costs, quickly detect anomalies, and auto-stop over-spending.
Disclaimer: Costs are for reference only. Actual costs should be calculated based on your platform subscription usage. We provide estimates that are as accurate as possible.
- Cost Monitoring - Know exactly how much each agent costs
- Anomaly Detection - Quickly spot abnormal spending (7-day average × 2)
- Auto-Stop - Automatically pause API when budget exceeded (key differentiator)
- Quick Start Guide - Get started in 10 minutes
npm install -g cost-controlcost-control initcost-control dashboardcost-control budget set 100cost-control alertcost-control stop <agent-id>
cost-control start <agent-id>cost-control guidecost-control/
├── cost-control.js # CLI entry point
├── package.json
├── src/
│ ├── api/ # API adapters
│ │ ├── openai.js # OpenAI adapter
│ │ └── claude.js # Claude adapter
│ ├── calculator.js # Cost calculation
│ ├── detector.js # Anomaly detection
│ ├── controller.js # Auto-stop controller
│ └── encrypt.js # AES-256 encryption
├── data/
│ └── .costguard # Encrypted data file
└── docs/
└── README.md # Full documentation
# Clone the project
git clone <repo>
cd cost-control
# Install dependencies
npm install
# Run in dev mode
npm run dev
# Test
npm testEach API adapter needs to implement:
class APIAdapter {
// Fetch raw data
async fetchData(options) {}
// Parse response
async parseResponse(data) {}
// Calculate cost
async calculateCost(data) {}
}┌─────────────────────────────────────┐
│ cost-control.js (single) │
│ │
│ ┌──────────────┐ ┌──────────────┐│
│ │ API Adapter │ │ Cost Calc ││
│ │ (unified) │ │(price config)││
│ └──────────────┘ └──────────────┘│
│ │ │ │
│ └────────┬───────┘ │
│ │ │
│ ┌─────────────────▼────────────────┐│
│ │ Dynamic Anomaly Detection ││
│ │ (7-day avg × 2 threshold) ││
│ └─────────────────┬────────────────┘│
│ │ │
│ ┌─────────────────▼────────────────┐│
│ │ Auto-Stop Controller ││
│ │ (Budget cap + Auto-pause) ││
│ └─────────────────┬────────────────┘│
│ │ │
│ ┌─────────────────▼────────────────┐│
│ │ Data Encryption (AES-256) ││
│ └─────────────────┬────────────────┘│
│ │ │
│ ┌─────────────────▼────────────────┐│
│ │ CLI Interface + Quick Start ││
│ └──────────────────────────────────┘│
└─────────────────────────────────────┘
| Week | Goal | Deliverable | Owner |
|---|---|---|---|
| Week 1 | Core + API Integration | Working cost-control.js |
Xiao Ka, Xiao Ma |
| Week 2 | Anomaly Alerts + Dynamic Algorithm | Alert feature integrated | Xiao Ka |
| Week 3 | Auto-Stop + Quick Start Guide | Auto-stop + guide | Xiao Ma |
| Week 4 | Data Privacy + Config | Full docs + security | Xiao Ka, Xiao Ma |
| Week 5 | Testing and Release | v1.0 Release | All |
- nia - Commander
- mia - Secretary / Task Management
- Xiao Ka - Development (API Integration + Anomaly Detection)
- Xiao Ma - Development (CLI + Auto-Stop)
MIT
Core Principles:
- Clear > Complex
- Stable > Showy
- Efficient > Performant
- Practical > Perfect