Skip to content

Usage metrics

The usage endpoint reports how many AI service units a tenant consumed per day: transcription minutes, LLM tokens, and Ask AI (copilot) tokens. Use it to bill tenants, or to watch consumption against the service limits of the tenant. See also Usage and token limits in the Operator Guide.

Daily usage

GET /api/v2/tenants/<tenant-id>/usage/<usage-type>/daily.json

<usage-type> is one of:

Usage type Unit
transcription_minutes Minutes of audio transcribed (whole minutes)
llm_tokens LLM tokens consumed by AI tasks
copilot_tokens Tokens consumed by Ask AI
Parameter Description
daterange Period to report, in the format YYYY/MM/DD-YYYY/MM/DD or YYYY/MM/DD. When omitted, or not in that format, the last 30 days (including today) are reported.

Example of request:

GET /api/v2/tenants/209e8a10-e250-4824-8567-43f48e07a060/usage/llm_tokens/daily.json?daterange=2024/06/01-2024/06/30

Example of response:

{
    "daily_usage": {
        "usage_type": "llm_tokens",
        "tenant_id": "209e8a10-e250-4824-8567-43f48e07a060",
        "date_from": "2024-06-01",
        "date_to": "2024-06-30",
        "data": [
            {"day": "2024-06-01", "value": 11760},
            {"day": "2024-06-03", "value": 5230},
            ...
            {"day": "2024-06-30", "value": 8420}
        ]
    }
}
Attribute Type Description
usage_type string The requested usage type.
tenant_id UUID The tenant.
date_from date First day of the reported period, YYYY-MM-DD.
date_to date Last day of the reported period, YYYY-MM-DD.
data list One item per day that has usage, with day (YYYY-MM-DD) and value (integer). Days without usage are omitted.

The role of the API user needs the View action of the Tenants permission.

Response contains HTTP status code as shown in the following table.

Response Description
200 OK The usage data is returned in the response body
403 Forbidden The request cannot be completed because API user has no permission to view tenants
404 Not Found Tenant with such ID does not exist, or the usage type is unknown