User Tools

Site Tools


api:ai:quota-history

API : AI quota : History

Introduction

This request returns a customer's AI usage month by month, for the last N calendar months up to and including the current one. It is the data behind the month-by-month chart on the AI usage page; the day-by-day numbers come from Usage timeseries instead.

The list is dense: a month in which the customer used nothing is returned with zeros rather than left out, and the months come oldest first. Months are calendar months in the Europe/Copenhagen timezone, formatted YYYY-MM.

The monthly counters are never deleted, so the history reaches as far back as the customer has been counted. The raw per-request log (AIUsage) is only kept for two years.

Request

URL https://api.telecomx.dk/ai/quota/history
Method GET
Access level MANAGER, OWNER for the user's own customer.
RESELLER, RESELLER_ADMIN or ADMIN, who may also name another customer with customer.
Query months [optional] Number of months back, including the current one. 1-60, default 24.
customer [optional] Id of the customer to show. Only honoured for RESELLER and up, and access to the customer is checked. Defaults to the user's own customer.

Query examples

https://api.telecomx.dk/ai/quota/history
https://api.telecomx.dk/ai/quota/history?months=12
https://api.telecomx.dk/ai/quota/history?months=12&customer=650000000000000000000101

Response

JSON object
months Array One entry per calendar month, oldest first.
months[].month String The month, YYYY-MM in Europe/Copenhagen.
months[].used.sttSeconds Number Transcription seconds consumed in the month.
months[].used.llmTokens Number Summary tokens (input + output) consumed in the month.
months[].used.ttsCharacters Number Text-to-speech characters consumed in the month.
months[].topUp.sttSeconds Number Transcription seconds added by top-up purchases in the month.
months[].topUp.llmTokens Number Summary tokens added by top-up purchases in the month.
months[].topUp.ttsCharacters Number Text-to-speech characters added by top-up purchases in the month.
months[].ttsSeconds Number Seconds of text-to-speech audio generated in the month (reported, not limited).
months[].requests.stt Number Counted transcription requests in the month.
months[].requests.llm Number Counted summary requests in the month.
months[].requests.tts Number Counted text-to-speech requests in the month.

Example

{
  "months": [
    {
      "month": "2026-07",
      "used": { "sttSeconds": 0, "llmTokens": 0, "ttsCharacters": 0 },
      "topUp": { "sttSeconds": 0, "llmTokens": 0, "ttsCharacters": 0 },
      "requests": { "stt": 0, "llm": 0, "tts": 0 }
    },
    {
      "month": "2026-08",
      "used": { "sttSeconds": 34120, "llmTokens": 1840221, "ttsCharacters": 41200 },
      "topUp": { "sttSeconds": 0, "llmTokens": 0, "ttsCharacters": 0 },
      "requests": { "stt": 502, "llm": 498, "tts": 61 }
    },
    {
      "month": "2026-09",
      "used": { "sttSeconds": 21044, "llmTokens": 1039880, "ttsCharacters": 54210 },
      "topUp": { "sttSeconds": 18000, "llmTokens": 0, "ttsCharacters": 0 },
      "requests": { "stt": 312, "llm": 287, "tts": 96 }
    }
  ]
}

Errors

Error code Message Description
422 months Months is out of range (1-60)
422 customer Customer id is invalid
403 access_denied Insufficient access level, or no access to the customer
500 internal_error <Unspecified>
api/ai/quota-history.txt · Last modified: by Telecom X AI

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki