Cost Tracking
Track and monitor all AI costs in real-time with comprehensive cost tracking capabilities.
Real-Time Cost Monitoring
View your AI spending as it happens with real-time dashboards and analytics.
// Get current costs
const costs = await ants.finops.getCurrentCosts()
console.log(`Today: $${costs.today}`)
console.log(`This month: $${costs.month}`)
console.log(`Hourly rate: $${costs.hourlyRate}/hour`)Cost Attribution
Attribute costs to specific customers, teams, or projects:
# Cost by customer
customer_costs = ants.finops.get_costs(
group_by='customer_id',
period='last_30_days'
)
for customer in customer_costs:
print(f"{customer.name}: ${customer.cost}")
print(f" Queries: {customer.query_count}")
print(f" Avg cost/query: ${customer.avg_cost}")Cost Breakdown
Understand where your money goes:
| Cost Category | Description | Typical % |
|---|---|---|
| LLM API Calls | GPT-4, Claude, etc. | 70-80% |
| Embeddings | Vector embeddings | 10-15% |
| Storage | Vector databases | 5-10% |
| Infrastructure | Compute, networking | 5-10% |
Cost Trends
Track spending over time:
const trends = await ants.finops.getTrends({
period: 'last_90_days',
granularity: 'daily'
})Next Steps
- Token Monitoring - Track token usage
- Budget Management - Set spending limits
- ROI Analytics - Measure business impact