Analytics

View detailed usage statistics and insights

Overview

Get comprehensive analytics for team usage including requests, costs, models, and performance metrics.

Authentication: OAuth token
Required Scopes: billing:read or teams:read


Get Team Analytics

View detailed usage analytics for a team.

Endpoint: GET /api/analytics/:slug

const response = await fetch(
  `https://hypery.ai/api/analytics/${teamSlug}?timeRange=7d`,
  { headers: { 'Authorization': `Bearer ${oauthToken}` } }
)
 
const analytics = await response.json()

Query Parameters

ParameterTypeOptionsDescription
timeRangestring1d, 7d, 30d, 90dTime period (default: 7d)

Response

{
  "overview": {
    "totalRequests": 5420,
    "totalCredits": 234.50,
    "avgResponseTime": 1250,
    "successRate": 98.5
  },
  "dailyStats": [
    {
      "date": "2025-11-16",
      "requests": 850,
      "credits": 42.25,
      "avgResponseTime": 1200,
      "successRate": 99.0
    }
  ],
  "modelUsage": [
    {
      "model": "anthropic/claude-3.5-sonnet",
      "requests": 3200,
      "credits": 156.75,
      "tokensUsed": 1250000
    }
  ],
  "serviceBreakdown": [
    {
      "service": "chat",
      "requests": 4200,
      "credits": 189.50
    },
    {
      "service": "images",
      "requests": 1220,
      "credits": 45.00
    }
  ],
  "endpointBreakdown": [
    {
      "endpoint": "/api/v1/chat/completions",
      "requests": 4200,
      "credits": 189.50,
      "avgResponseTime": 1150,
      "successRate": 98.8
    }
  ],
  "recentRequests": [
    {
      "id": "...",
      "endpoint": "/api/v1/chat/completions",
      "model": "anthropic/claude-3.5-sonnet",
      "status": "success",
      "credits": 0.05,
      "tokensUsed": 523,
      "requestDuration": 1200,
      "requestedAt": "2025-11-16T10:30:00Z"
    }
  ]
}

Output Fields

FieldTypeDescription
overviewobjectSummary statistics
dailyStatsarrayDaily usage breakdown
modelUsagearrayTop 10 models by usage
serviceBreakdownarrayUsage by API type (chat, images)
endpointBreakdownarrayUsage by endpoint
recentRequestsarrayLast 50 requests

Export Analytics

Export analytics data as CSV.

Endpoint: GET /api/analytics/export

const response = await fetch(
  'https://hypery.ai/api/analytics/export?timeRange=30d',
  { headers: { 'Authorization': `Bearer ${oauthToken}` } }
)
 
const csvData = await response.text()

Next Steps