📊 Usage Controller Guide#
Track your API usage with simple metrics.
The Usage Controller provides a straightforward way to monitor your API consumption across different models and time periods.🎯 When to Use This Controller#
Usage monitoring - Track total requests and tokens used
Model comparison - See usage across different models
Cost estimation - Use token counts to estimate costs
Usage patterns - Analyze average tokens per request
🚀 Endpoint#
GET /api/Usage#
Retrieve usage data across models and time periods.📋 Response Schema#
🔍 Example Response#
[
{
"monthYear": "2023-07",
"model": "gpt-4",
"totalRequests": 1250,
"totalTokens": 3750000,
"averageTokensPerRequest": 3000,
"customer": "acme-corp"
},
{
"monthYear": "2023-07",
"model": "gpt-3.5-turbo",
"totalRequests": 8500,
"totalTokens": 12750000,
"averageTokensPerRequest": 1500,
"customer": "acme-corp"
}
]
🜈 Real-World Examples#
💰 Department Chargebacks SOON#
🚨 Usage Alerts & Anomaly Detection SOON#
🔍 Optimization Recommendations SOON#
📊 Visualization Examples SOON#
🔄 Real-Time Monitoring SOON#
🔧 Best Practices#
1.
Track usage trends - Monitor monthly changes in token consumption
2.
Compare model efficiency - Evaluate which models give the best results per token
3.
Set usage alerts - Create custom alerts based on token thresholds
4.
Regular reporting - Generate monthly usage reports for budgeting
5.
Optimize prompts - Use data to identify opportunities for prompt engineering improvements
6.
Model selection - Choose appropriate models based on complexity of tasks
Remember: Regular monitoring of your API usage helps optimize costs and improve application performance.🎁 Pro Tips#
1.
Set up automated reports: Schedule weekly/monthly usage reports
2.
Use tags extensively: Better tags = better cost allocation
3.
Monitor patterns: Unusual usage often indicates issues
4.
Implement quotas early: Easier to relax than to restrict later
5.
Archive usage data: Historical data is gold for optimization
Usage Tracking Checklist:Need help optimizing your usage? Email us Modificado em 2025-07-16 20:45:05