npm install -g @aicostguard/cli
# Set your API key
aicostguard auth login
# Or use environment variable
export COST_GUARD_API_KEY=cg_your_key_here
# View real-time cost summary
aicostguard dashboard
# Filter by project
aicostguard dashboard --project my-chatbot
# Filter by date range
aicostguard dashboard --from 2026-03-01 --to 2026-03-15
# View costs grouped by model
aicostguard costs --group-by model
# View costs grouped by feature
aicostguard costs --group-by feature --period weekly
# Export as CSV
aicostguard costs --format csv --output costs.csv
# Export as JSON
aicostguard costs --format json
# List active budgets
aicostguard budgets list
# Create a budget
aicostguard budgets create \
--name "Production Daily" \
--amount 100 \
--period daily \
--alert-at 50,80,100 \
--auto-stop
# Delete a budget
aicostguard budgets delete --id budget_abc123
# List projects
aicostguard projects list
# Create a project
aicostguard projects create --name "My Chatbot"
# View project costs
aicostguard projects costs --id proj_abc123
# View recent alerts
aicostguard alerts list
# Acknowledge an alert
aicostguard alerts ack --id alert_abc123
# Simulate switching models
aicostguard 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%)