📦 Install
npm install -g ai-cost-cli
🔑 Login
# Set your API key ai-cost auth login # Or use environment variable export COST_GUARD_API_KEY=acg_live_your_key_here
📊 Commands
View Your Dashboard
# View real-time cost summary ai-cost dashboard # Filter by project ai-cost dashboard --project my-chatbot # Filter by date range ai-cost dashboard --from 2026-03-01 --to 2026-03-15
Query Costs
# View costs grouped by model ai-cost costs --group-by model # View costs grouped by feature ai-cost costs --group-by feature --period weekly # Export as CSV ai-cost costs --format csv --output costs.csv # Export as JSON ai-cost costs --format json
Manage Budgets
# List active budgets ai-cost budgets list # Create a budget ai-cost budgets create \ --name "Production Daily" \ --amount 100 \ --period daily \ --alert-at 50,80,100 \ --auto-stop # Delete a budget ai-cost budgets delete --id budget_abc123
Projects
# List projects ai-cost projects list # Create a project ai-cost projects create --name "My Chatbot" # View project costs ai-cost projects costs --id proj_abc123
Alerts
# View recent alerts ai-cost alerts list # Acknowledge an alert ai-cost alerts ack --id alert_abc123
Model Simulation
Want to know how much you'd save by switching models?
# Simulate switching models ai-cost simulate \ --from gpt-4 \ --to gpt-4o-mini \ --project my-chatbot # Output: # Current cost: $4,200/month (GPT-4) # Projected cost: $42/month (GPT-4o-mini) # Savings: $4,158/month (99%)
🔧 Global Options
| Flag | Description |
|---|---|
--api-key |
Override API key |
--project |
Filter by project |
--format |
Output format: table, json, csv |
--no-color |
Disable colored output |
--verbose |
Enable debug output |