First Dashboards
Understanding the metrics, reports, and visualizations available in LensAI
First Dashboards
Once you've integrated LensAI and are capturing events, you gain immediate access to dashboards and reports that show the complete financial and operational picture of your AI systems. This guide introduces the key metrics and visualizations you'll see in your LensAI dashboard.
Overview Dashboard
The Overview dashboard provides a high-level snapshot of your AI operations. This is typically the first view you'll see when opening a project.
Key Metrics
Total Cost The cumulative amount spent on LLM API calls, tool invocations, and other metered services. LensAI automatically calculates costs based on token usage and current provider pricing. Costs are updated in real-time as new requests are processed.
Request Volume Total number of API calls made through LensAI. This metric helps you understand usage patterns and identify spikes or anomalies in traffic.
Average Latency Mean response time across all requests. Latency tracking helps you monitor performance and identify slow interactions that may impact user experience.
Token Usage Breakdown of tokens consumed, split between prompt tokens (input) and completion tokens (output). Since pricing often differs between input and output tokens, this breakdown is essential for cost optimization.
Time-Series Visualizations
The Overview dashboard includes time-series charts showing how these metrics evolve over time. You can adjust the time range (last hour, day, week, month) to spot trends, track the impact of changes, or investigate incidents.
Cost Analytics
The Cost Analytics dashboard helps you understand where your AI spending goes and identify optimization opportunities.
Cost by Model
See which models account for the majority of your spending. For example, you might discover that GPT-4 calls represent 80% of total costs while GPT-3.5 calls represent only 20%, despite higher request volume. This insight might prompt you to route more requests to cheaper models when appropriate.
Cost by Agent
If you've tagged events with agent identifiers (e.g., "agent": "customer_support" in metadata), LensAI attributes costs to specific agents. This allows you to answer questions like:
- Which agents are most expensive to operate?
- Are costs proportional to the value each agent delivers?
- Can we optimize expensive agents without reducing effectiveness?
Cost by Customer
When you include customer identifiers in event metadata, LensAI aggregates costs per customer. This is critical for understanding unit economics and identifying unprofitable customer segments. You can sort customers by total cost, filter by cost thresholds, and drill down into individual customer usage patterns.
Cost Trends and Forecasting
LensAI tracks cost trends over time and provides basic forecasting based on recent usage patterns. If spending is accelerating faster than expected, you'll see alerts and can investigate the root cause before budget overruns occur.
Value Tracking
While costs are automatically captured, value requires you to explicitly define and track what constitutes meaningful outcomes for your users.
Recording Value
You can record value in two ways:
1. Event-level value: When making an LLM call, include a value field in metadata:
const response = await client.chat.completions.create({
model: 'gpt-4',
messages: [...],
metadata: {
value: 15.00, // USD value delivered by this interaction
value_type: 'time_saved' // Optional: categorize the type of value
}
});2. Session-level value: After a complete interaction, record the total value delivered:
await client.sessions.recordValue({
session_id: 'session_456',
value: 50.00,
value_type: 'issue_resolved',
description: 'Customer support issue resolved without human escalation'
});Value Metrics
Total Value Delivered The cumulative value your AI has delivered to users, expressed in USD or your chosen currency. This is the aggregate of all value events you've recorded.
Value by Agent Compare value delivery across different agents. Which agents create the most value for users? Are high-cost agents also high-value?
Value by Customer Understand which customers benefit most from your AI features. This segmentation helps prioritize development efforts and identify expansion opportunities.
Revenue Attribution
Revenue tracking connects customer payments to AI usage, enabling margin and profitability analysis.
Recording Revenue
Map revenue to customers or sessions:
await client.revenue.record({
customer_id: 'user_123',
amount: 99.00,
currency: 'USD',
description: 'Monthly subscription - Pro plan',
metadata: {
plan: 'pro',
billing_period: '2025-01'
}
});LensAI then attributes this revenue to the AI usage associated with that customer during the billing period.
Revenue Metrics
Total Revenue Aggregate revenue from all customers using AI-powered features.
Revenue by Customer Segment Break down revenue by customer attributes (plan tier, industry, geography, etc.) to identify your most valuable segments.
Revenue Attribution LensAI correlates revenue with AI usage to answer: "How much of our revenue is directly attributable to AI-powered features?" This is calculated by analyzing which customers actively use AI features versus those who don't, and measuring the revenue difference.
Key Ratios and Unit Economics
The real power of LensAI comes from comparing costs, value, and revenue to understand the economic efficiency of your AI systems.
Value-to-Cost Ratio (ROI)
Value-to-Cost = Total Value Delivered / Total CostThis ratio tells you how much value your AI creates for every dollar spent. A ratio above 1.0 means you're delivering more value than it costs to operate. A ratio of 5.0 means you deliver $5 of value for every $1 spent—a strong indicator of positive ROI.
Example: If your customer support agent costs $500/month to operate (LLM costs) and delivers $3,000 in value (time saved, churn prevented), your value-to-cost ratio is 6.0.
Revenue-to-Cost Ratio (Gross Margin)
Revenue-to-Cost = Total Revenue / Total CostThis ratio shows your gross margin on AI features. A ratio of 3.0 means you earn $3 for every $1 spent on AI infrastructure.
Example: If you charge customers $10/month for AI features and those features cost $2/month in LLM expenses, your revenue-to-cost ratio is 5.0 (80% gross margin).
Cost per Session
Cost per Session = Total Cost / Total SessionsThis metric helps you understand the average cost of a complete customer interaction. Tracking cost per session over time reveals whether optimizations are working or if complexity is driving costs up.
Cost per Customer
Cost per Customer = Total Cost / Number of Active CustomersEssential for SaaS businesses, this metric shows the average AI cost attributable to each customer. Compare this against revenue per customer to ensure healthy unit economics.
Sample Reports
LensAI provides pre-built reports that combine these metrics into actionable insights:
Agent Performance Report
Compares all agents across key dimensions:
- Total cost
- Request volume
- Average cost per request
- Total value delivered
- Value-to-cost ratio
- Average latency
This report helps you identify which agents are most efficient and which need optimization.
Customer Profitability Report
Shows the economics of each customer or customer segment:
- AI usage (request count, tokens)
- Total cost (what you spend serving this customer)
- Total value delivered to the customer
- Revenue from the customer
- Net margin (revenue minus cost)
- Profitability score
Use this report to identify your most profitable customers, detect unprofitable segments, and inform pricing strategy.
Cost Optimization Report
Highlights opportunities to reduce costs without sacrificing quality:
- Expensive requests (high token count or premium models)
- Model usage breakdown (identify opportunities to use cheaper models)
- Requests with low value-to-cost ratios
- Peak usage times (consider rate limiting or queue management)
Time-Based Analysis
Track how metrics evolve across time periods:
- Week-over-week cost growth
- Month-over-month value delivery
- Seasonal patterns in usage
- Impact of product changes on costs and value
Customizing Your Dashboards
You can customize dashboards to focus on the metrics most relevant to your business:
- Filter by date range to analyze specific time periods
- Segment by metadata fields (customer attributes, agent types, feature flags, etc.)
- Create custom views that combine multiple metrics
- Set up alerts for threshold breaches (e.g., daily cost exceeds $500)
- Export data for deeper analysis in your BI tools
Interpreting Your Data
As you explore your dashboards, keep these principles in mind:
Start with business outcomes, not operational metrics. Yes, you can see token counts and request volumes, but the real questions are: "Are we profitable?" and "Are we delivering value?"
Context matters. A high cost might be perfectly justified if value and revenue are proportionally higher. A low cost might be concerning if it indicates underutilization of valuable features.
Track trends, not just snapshots. A single day's metrics can be misleading. Look for patterns over time to understand what's normal and what's anomalous.
Segment aggressively. Aggregated metrics hide important details. Break down by customer, agent, time period, and custom attributes to find actionable insights.
Iterate and optimize. Use dashboards to form hypotheses ("I think switching to GPT-3.5 for simple queries will reduce costs by 30%"), make changes, and measure the impact. LensAI gives you the data to prove whether optimizations work.
Next Steps
Now that you understand the dashboards and metrics available to you, you're ready to:
- Add more context to your events to enable richer segmentation and attribution
- Define goals and outcomes to track whether your AI achieves its intended objectives
- Set up alerting to be notified of cost spikes, performance degradation, or other anomalies
- Explore advanced concepts like cost attribution, value modeling, and revenue mapping in the Concepts section
The journey from basic event tracking to comprehensive AI business intelligence is incremental. Start with the Overview dashboard, add context as you identify questions you want to answer, and progressively build more sophisticated analytics as your AI systems mature.