Skip to Content
FeaturesAnalytics

Analytics

Deep dive into your AI spending patterns and optimization opportunities.

Analytics features are available on Pro and Enterprise tiers.

Overview

Analytics gives you advanced insights into:

  • Spending trends and forecasts
  • Model efficiency comparisons
  • Customer profitability
  • Feature cost analysis
  • Optimization opportunities

Time Series Analysis

View cost trends over:

  • Hourly - Last 24 hours
  • Daily - Last 7, 30, or 90 days
  • Weekly - Last 12 weeks
  • Monthly - Last 12 months

Chart features:

  • Zoom and pan
  • Compare time periods
  • Overlay different metrics
  • Export as PNG/CSV

Forecast

AI-powered spending forecast:

  • Predicts next 30 days
  • Based on historical patterns
  • Accounts for trends and seasonality
  • Confidence intervals shown

Example:

Current month: $450 (18 days elapsed) Forecast: $750 ยฑ $50 (end of month) Recommendation: On track for budget

Anomaly Detection

Automatically detects unusual patterns:

  • Unexpected cost spikes
  • Model switching
  • Traffic patterns
  • Error rate changes

Alert types:

  • ๐Ÿ”ด Critical - Costs 3x normal
  • ๐ŸŸก Warning - Costs 2x normal
  • ๐Ÿ”ต Info - Unusual but not concerning

Model Performance

Cost per Model

Compare models by:

  • Total cost
  • Cost per 1,000 tokens
  • Average latency
  • Error rate
  • Usage frequency

Example table:

ModelTotal CostAvg LatencyError RateUsage
gpt-4$234.502,340ms0.5%12,450
gpt-3.5$45.20890ms0.2%89,230
claude-3-opus$123.401,450ms0.3%8,120

Model Recommendations

AI suggests model optimizations:

Example:

๐Ÿ’ก Optimization Opportunity Feature: content-summarization Current: gpt-4 ($234/month) Suggested: claude-3-sonnet ($89/month) Savings: $145/month (62% reduction) Quality: Comparable (based on benchmarks) Action: Run A/B test โ†’

Token Efficiency

Analyze token usage:

  • Average tokens per request
  • Prompt vs completion ratio
  • Token waste detection
  • Optimization suggestions

Token waste indicators:

  • Long system prompts (repeated unnecessarily)
  • Excessive context (entire docs when summary needed)
  • Redundant API calls (caching opportunities)

Customer Analytics

Customer Profitability

See which customers are profitable:

Profitability score:

Revenue - (AI costs + other costs) = Profit Profit / Revenue = Margin %

Dashboard shows:

  • Top 10 most profitable customers
  • Top 10 least profitable customers
  • Customer margin distribution
  • Churn risk by profitability

Customer Segments

Segment customers by:

  • Spending level (low/medium/high)
  • Growth rate (growing/stable/declining)
  • Model preference (GPT-4, Claude, mix)
  • Feature usage (power users vs casual)

Use cases:

  • Pricing tier placement
  • Upsell opportunities
  • Churn prevention
  • Feature targeting

Cohort Analysis

Track customer cohorts over time:

  • Signup month cohorts
  • Spending evolution
  • Retention by cost tier
  • Lifetime value (LTV)

Feature Analytics

Feature Performance

Compare features by:

  • Total cost
  • Cost per user
  • Usage frequency
  • User satisfaction (if tracked)

Example:

FeatureCostUsersCost/UserTrend
Chat$4501,200$0.38โ†‘ 12%
Summarize$234800$0.29โ†“ 5%
Translate$89450$0.20โ†’

Feature ROI

Calculate ROI per feature:

Formula:

Revenue from feature - Cost of feature = Profit Profit / Cost = ROI %

Requires revenue attribution (manual input or integration).

Feature Optimization

AI suggests feature improvements:

Example:

๐Ÿ“Š Feature Insight: email-summarization Current usage: - 450 calls/day - $8.50/day cost - gpt-4 model Opportunity: Switch to claude-3-haiku for emails <500 words Estimated savings: $4.20/day ($126/month) Quality impact: Minimal

Cost Optimization

Optimization Score

Overall score (0-100) based on:

  • Model selection efficiency
  • Token usage efficiency
  • Caching opportunities
  • Error rate
  • Rate limit headroom

Example:

Your Optimization Score: 72/100 โœ… Strengths: - Low error rate (0.3%) - Good model selection โš ๏ธ Opportunities: - High token waste (18%) - No caching implemented - Inefficient prompts detected Potential savings: $234/month

Caching Opportunities

Identify repeated requests:

  • Same prompts sent multiple times
  • Similar prompts (can be cached)
  • Static context (system prompts)

Savings calculator:

Repeated calls detected: 1,240/week Current cost: $45/week With caching: $12/week Savings: $33/week ($143/month)

Prompt Optimization

Analyze prompts for efficiency:

  • Token count distribution
  • Long prompts (>500 tokens)
  • Repeated instructions
  • Unnecessary context

Suggestions:

  • Shorten system prompts
  • Remove redundant context
  • Use prompt templates
  • Implement prompt compression

Reports

Automated Reports

Schedule reports:

  • Daily - Cost summary, top models
  • Weekly - Trends, anomalies, recommendations
  • Monthly - Full analytics, forecasts, optimization

Delivery:

  • Email (PDF attached)
  • Slack (summary + link)
  • Webhook (JSON data)

Custom Reports

Build custom reports:

  1. Choose metrics (cost, tokens, latency, etc.)
  2. Choose dimensions (model, customer, feature)
  3. Choose time range
  4. Add filters
  5. Schedule or download

Export formats:

  • PDF (with charts)
  • CSV (raw data)
  • JSON (via API)
  • Excel (Pro+)

Report Templates

Pre-built templates:

  • Executive Summary - High-level overview for leadership
  • Engineering Metrics - Latency, errors, performance
  • Finance Report - Costs, forecasts, budgets
  • Customer Report - Per-customer analytics

Integrations

Data Export

Export analytics data to:

  • Google Sheets - Auto-sync daily/weekly
  • Excel - Download or email
  • Data warehouse - BigQuery, Snowflake (Enterprise)
  • BI tools - Tableau, Looker, Power BI (Enterprise)

API Access

Programmatic access to analytics:

// Get cost analytics const analytics = await fetch('https://api.aispendtrack.com/v1/analytics/costs', { headers: { 'Authorization': 'Bearer your_api_key', 'Content-Type': 'application/json' }, body: JSON.stringify({ start_date: '2024-01-01', end_date: '2024-01-31', group_by: 'model' }) });

Full API documentation โ†’

Best Practices

1. Review Weekly

Set aside time each week:

  • Check spending trends
  • Review top costs
  • Implement one optimization
  • Track savings

2. Set Baselines

Establish baselines for:

  • Average daily cost
  • Cost per customer
  • Cost per feature
  • Token efficiency

Track improvements over time.

3. A/B Test Optimizations

Before making changes:

  • Implement change for 10% of traffic
  • Monitor for 7 days
  • Compare quality and cost
  • Roll out if successful

4. Automate Reports

Set up automated reports:

  • Daily summary for yourself
  • Weekly report for team
  • Monthly report for finance/leadership

5. Track ROI

Measure impact of optimizations:

  • Cost before optimization
  • Cost after optimization
  • Savings per month
  • Quality impact (if any)

Analytics Roadmap

Coming soon:

  • ๐Ÿ”œ Real-time analytics (sub-second updates)
  • ๐Ÿ”œ Custom dashboards
  • ๐Ÿ”œ Advanced forecasting (ML-based)
  • ๐Ÿ”œ Benchmark against similar companies
  • ๐Ÿ”œ Carbon footprint tracking
  • ๐Ÿ”œ Multi-account rollups (Enterprise)

Next Steps

Last updated on