Get Usage
Developer Tools
Get Usage
Get detailed usage statistics for API keys
GET
Get Usage
Overview
Retrieve comprehensive usage statistics and analytics for your API keys. This endpoint provides detailed insights into API usage patterns, rate limit consumption, and performance metrics to help optimize your API key management.Parameters
Specific API key ID to get usage for (optional)
Time period for usage data
1h- Last hour24h- Last 24 hours (default)7d- Last 7 days30d- Last 30 days90d- Last 90 days1y- Last yearall- All time
Data granularity for time series
minute- Per-minute datahour- Per-hour data (default)day- Per-day dataweek- Per-week datamonth- Per-month data
Include detailed breakdown by endpoint (default: true)
Include error statistics (default: true)
Include latency statistics (default: true)
Sort results by field
requests- By request count (default)errors- By error countlatency- By average latencytimestamp- By timestamp
Sort order
desc- Descending (default)asc- Ascending
Number of results to return (default: 100, max: 1000)
Number of results to skip for pagination (default: 0)
Response
Indicates if the request was successful
Usage statistics
Time series data points
Breakdown by endpoint
Error statistics
Rate limit information
Usage alerts and recommendations
Pagination information
ISO 8601 timestamp of the response
Examples
Response Example
Use Cases
1. Usage Monitoring Dashboard
Create a comprehensive usage dashboard:2. Performance Optimization
Optimize API usage based on data:3. Cost Analysis
Analyze API usage costs:4. Alert Management
Manage usage alerts:5. Capacity Planning
Plan for future capacity needs:Best Practices
1. Regular Monitoring
Monitor usage regularly:2. Automated Alerts
Set up automated alerts:3. Performance Optimization
Optimize based on usage data:4. Cost Optimization
Optimize costs:Related Endpoints
- List API Keys - View all API keys
- Create API Key - Create new API keys
- Revoke API Key - Revoke API keys
Troubleshooting
”No usage data found”
Cause: No usage data for the specified timeframe or key. Solution:- Check if the API key has been used
- Try a longer timeframe
- Verify the key ID is correct
”Invalid timeframe”
Cause: Unsupported timeframe value. Solution:- Use supported timeframes: 1h, 24h, 7d, 30d, 90d, 1y, all
- Check for typos
”Invalid granularity”
Cause: Unsupported granularity value. Solution:- Use supported granularities: minute, hour, day, week, month
- Check for typos
Rate Limits
Usage requests are subject to rate limits:- Free tier: 60 requests per minute
- Starter tier: 300 requests per minute
- Professional tier: 1,000 requests per minute
- Enterprise tier: Custom limits