Usage Analytics

AISentinel provides comprehensive usage analytics to help you monitor system performance, track costs, and optimize your AI agent deployments.

Usage Metrics

Agent Activity

Track all AI agent interactions and tool executions:

Metrics Tracked:

  • Total requests processed
  • Tool execution counts by type
  • Success/failure rates
  • Response times and latency

Cost Analysis

Monitor and control costs associated with AI agent operations:

Cost Components:

  • LLM API costs (per-token pricing)
  • Tool execution costs
  • Infrastructure costs
  • Bandwidth and storage costs

Performance Monitoring

Track system performance and identify optimization opportunities:

Performance Metrics:

  • Average response times
  • Peak usage periods
  • Error rates by component
  • Resource utilization

Usage Dashboard

Real-time Monitoring

  • Live usage statistics
  • Current active sessions
  • Recent activity feed
  • System health indicators

Historical Analytics

  • Usage trends over time
  • Cost breakdowns by category
  • Performance comparisons
  • Seasonal usage patterns

Custom Reports

  • Generate usage reports for specific time periods
  • Filter by team, project, or API key
  • Export data for external analysis
  • Schedule automated reports

Billing Integration

Usage-based Billing

AISentinel supports flexible billing models:

Billing Types:

  • Per-request pricing
  • Monthly usage tiers
  • Custom enterprise plans
  • Pay-as-you-go options

Cost Controls

Prevent unexpected costs with built-in controls:

Cost Management:

  • Usage quotas and limits
  • Budget alerts and notifications
  • Automatic throttling
  • Cost prediction tools

Usage API

Fetching Usage Data

// Get current usage statistics
const usage = await fetch('/api/usage/current');

// Get usage history
const history = await fetch('/api/usage/history?start=2024-01-01&end=2024-01-31');

// Get usage by API key
const keyUsage = await fetch('/api/usage/by-key/abc123');

Usage Webhooks

Receive real-time usage notifications:

  • Usage threshold alerts
  • Cost limit warnings
  • Billing period summaries

Usage Optimization

Cost Optimization

Reduce costs while maintaining performance:

Optimization Strategies:

  • Implement usage quotas
  • Use cost-effective LLM models
  • Optimize tool selection
  • Cache frequently used results

Performance Optimization

Improve response times and reliability:

Performance Tips:

  • Monitor and reduce latency
  • Optimize rulepack complexity
  • Use appropriate risk assessment levels
  • Implement request batching

Usage Limits and Quotas

Default Limits

  • 1,000 requests per month (free tier)
  • 10,000 requests per month (basic tier)
  • Unlimited (enterprise tier)

Custom Quotas

Configure custom limits based on your needs:

  • Per-user quotas
  • Per-API key limits
  • Time-based restrictions
  • Geographic restrictions

Monitoring and Alerts

Usage Alerts

Set up alerts for important usage events:

Alert Types:

  • Usage threshold exceeded
  • Cost limit approaching
  • Performance degradation
  • Security incidents

Dashboard Notifications

Receive notifications through the dashboard:

  • Real-time usage updates
  • Weekly usage summaries
  • Cost reports
  • System maintenance alerts

Compliance and Auditing

Usage Auditing

Track all usage for compliance purposes:

Audit Features:

  • Complete usage logs
  • User activity tracking
  • API key usage history
  • Compliance reporting

Data Retention

Usage data retention policies:

  • Real-time data: 30 days
  • Aggregated data: 1 year
  • Audit logs: 7 years (enterprise)

Troubleshooting

High Usage Issues

  • Identify usage spikes
  • Check for API key abuse
  • Review rate limiting settings
  • Optimize expensive operations

Cost Issues

  • Monitor cost per request
  • Review LLM model usage
  • Check for unnecessary tool calls
  • Implement cost controls

Performance Issues

  • Monitor response times
  • Check system resource usage
  • Review rulepack complexity
  • Optimize database queries