What are User Metrics?
User metrics let you track LLM usage at the user level. Monitor which users are driving costs, identify power users, analyze usage patterns, and implement usage-based billing.Why Track Users?
Cost Attribution
Know exactly how much each user costs your application
Usage-Based Billing
Charge users based on their actual LLM usage
Rate Limiting
Set per-user rate limits and quotas
User Analytics
Understand user engagement and behavior patterns
Support & Debugging
Debug issues for specific users
Churn Prevention
Identify users with issues or low engagement
Adding User IDs
Track users with theHelicone-User-Id header:
string
required
Unique identifier for the user making the request. Can be any string that uniquely identifies your users (UUID, database ID, email hash, etc.).
Basic Example
What Metrics are Tracked?
For each user, Helicone tracks:Usage Metrics
- Total Requests: Number of LLM requests made
- Total Tokens: Prompt tokens + completion tokens
- Request Frequency: Requests per day/week/month
- Active Days: Days with at least one request
Cost Metrics
- Total Cost: Cumulative spend in USD
- Average Cost per Request: Mean cost across requests
- Cost Trend: Spending over time
- Most Expensive Requests: Highest cost requests
Performance Metrics
- Average Latency: Mean response time
- Success Rate: Percentage of successful requests
- Error Rate: Percentage of failed requests
- Models Used: Which models the user accesses
Engagement Metrics
- Session Count: Number of sessions
- Requests per Session: Average session length
- Last Active: Most recent request timestamp
- First Seen: First request timestamp
Viewing User Metrics
Access user analytics in the dashboard:1
Navigate to Users
Go to the Users page in your Helicone dashboard
2
View User List
See all users with their key metrics: total cost, request count, last active
3
Click a User
View detailed metrics, request history, and trends for a specific user
4
Filter Requests
Click “View Requests” to see all requests from that user
Filtering by User
Find requests from specific users:Dashboard Filtering
- Go to Requests page
- Add filter: User ID equals
user_123456 - See all requests from that user
API Filtering
User Context with Properties
Combine user IDs with custom properties for richer analytics:- Cost per subscription tier
- Usage patterns by user segment
- Performance differences across plans
Use Cases
Usage-Based Billing
Charge users based on their actual consumption:Per-User Rate Limiting
Implement custom rate limits per user:Power User Identification
Find your most active users:User Support
Debug issues for specific users:Churn Prevention
Identify users at risk:User ID Best Practices
Use Consistent IDs
Use Consistent IDs
Use the same identifier across your application:
- Database primary key
- UUID from your auth system
- Hashed email (for privacy)
Hash Sensitive Data
Hash Sensitive Data
If using email or username, hash it first:
Handle Anonymous Users
Handle Anonymous Users
For logged-out users, use session IDs or device IDs:
Don't Store PII
Don't Store PII
Never use raw email addresses, phone numbers, or other PII as user IDs. Use opaque identifiers.
Combining with Sessions
Track both user identity and conversation context:- How many sessions per user?
- What’s the average session length per user?
- Which users have the longest conversations?
User Privacy Considerations
Next Steps
Custom Properties
Add user context with properties
Session Tracking
Track per-user sessions
Request Logging
View individual user requests
Rate Limiting
Set per-user rate limits