Admin Statistics

Platform-wide statistics and usage analytics for internal management.

Internal management API. These endpoints are authenticated via TutorFlow admin auth, not via Platform API keys.

GET /v1/platform/admin/stats

Get platform-wide aggregated statistics.

Query Parameters

ParameterTypeRequiredDescription
startDatestringNoISO 8601 date to filter from
endDatestringNoISO 8601 date to filter until
servicestringNoFilter by service (e.g., evaluation, course)

Example Request

curl "https://api.tutorflow.io/v1/platform/admin/stats?startDate=2025-01-01&endDate=2025-01-31" \
  -H "Authorization: Bearer tf_platform_..."

Response Fields

FieldTypeDescription
totalOrganizationsnumberTotal number of organizations on the platform
totalApiKeysnumberTotal number of API keys issued
totalRequestsnumberTotal number of API requests processed
totalCreditCostnumberTotal credits consumed across all organizations
totalBillableAmountUsdnumberTotal billable amount in USD
totalFinalizedAmountUsdnumberTotal finalized (invoiced) amount in USD
totalInputTokensnumberTotal input tokens consumed by AI models
totalOutputTokensnumberTotal output tokens produced by AI models
byServicearrayBreakdown of usage by service type
byService[].servicestringService name (e.g., evaluation, course)
byService[].countnumberNumber of requests for this service
byService[].creditCostnumberCredits consumed by this service
byService[].billableAmountUsdnumberBillable amount in USD for this service
byService[].finalizedAmountUsdnumberFinalized amount in USD for this service

Example Response

{
  "totalOrganizations": 42,
  "totalApiKeys": 87,
  "totalRequests": 15230,
  "totalCreditCost": 4521.75,
  "totalBillableAmountUsd": 1892.40,
  "totalFinalizedAmountUsd": 1650.00,
  "totalInputTokens": 28450000,
  "totalOutputTokens": 12300000,
  "byService": [
    {
      "service": "evaluation",
      "count": 12400,
      "creditCost": 3100.00,
      "billableAmountUsd": 1240.00,
      "finalizedAmountUsd": 1100.00
    },
    {
      "service": "course",
      "count": 2830,
      "creditCost": 1421.75,
      "billableAmountUsd": 652.40,
      "finalizedAmountUsd": 550.00
    }
  ]
}

GET /v1/platform/admin/stats/daily

Get daily usage breakdown for the platform.

Query Parameters

ParameterTypeRequiredDescription
startDatestringNoISO 8601 date to filter from
endDatestringNoISO 8601 date to filter until
servicestringNoFilter by service

Example Request

curl "https://api.tutorflow.io/v1/platform/admin/stats/daily?startDate=2025-01-01&endDate=2025-01-31" \
  -H "Authorization: Bearer tf_platform_..."

Response Fields

The response is an array of daily usage records.

FieldTypeDescription
datestringDate in YYYY-MM-DD format
requestsnumberNumber of requests on this date
creditCostnumberCredits consumed on this date
billableAmountUsdnumberBillable amount in USD for this date
finalizedAmountUsdnumberFinalized amount in USD for this date
inputTokensnumberInput tokens consumed on this date
outputTokensnumberOutput tokens produced on this date

Example Response

[
  {
    "date": "2026-01-15",
    "requests": 523,
    "creditCost": 156.75,
    "billableAmountUsd": 65.30,
    "finalizedAmountUsd": 58.00,
    "inputTokens": 980000,
    "outputTokens": 420000
  },
  {
    "date": "2026-01-16",
    "requests": 487,
    "creditCost": 142.10,
    "billableAmountUsd": 59.80,
    "finalizedAmountUsd": 54.50,
    "inputTokens": 910000,
    "outputTokens": 395000
  }
]

GET /v1/platform/admin/stats/organizations

Get usage statistics ranked by organization. Returns up to 50 organizations sorted by usage volume (descending).

This endpoint does not currently accept query parameters. It returns all-time usage across all organizations.

Example Request

curl "https://api.tutorflow.io/v1/platform/admin/stats/organizations" \
  -H "Authorization: Bearer tf_platform_..."

Response Fields

The response is an array of organization usage summaries.

FieldTypeDescription
organizationIdstringUnique identifier of the organization
organizationNamestringDisplay name of the organization
organizationSlugstringURL-safe slug of the organization
totalRequestsnumberTotal requests made by this organization
totalCreditCostnumberTotal credits consumed by this organization
totalBillableAmountUsdnumberTotal billable amount in USD
totalFinalizedAmountUsdnumberTotal finalized amount in USD

Example Response

[
  {
    "organizationId": "b3f1a2c4-d5e6-7f8a-9b0c-1d2e3f4a5b6c",
    "organizationName": "Acme University",
    "organizationSlug": "acme-university",
    "totalRequests": 4820,
    "totalCreditCost": 1205.00,
    "totalBillableAmountUsd": 502.10,
    "totalFinalizedAmountUsd": 450.00
  },
  {
    "organizationId": "c4d5e6f7-a8b9-0c1d-2e3f-4a5b6c7d8e9f",
    "organizationName": "LearnCo Academy",
    "organizationSlug": "learnco-academy",
    "totalRequests": 3150,
    "totalCreditCost": 892.50,
    "totalBillableAmountUsd": 378.20,
    "totalFinalizedAmountUsd": 340.00
  }
]