Zum Hauptinhalt springen

Get aggregated token usage statistics for an ai hosting plan of a customer

GET/v2/customers/{customerId}/ai-hostings/{planId}/usage/
API version
v2
Request method
GET
Operation ID
ai-hosting-plan-get-usage-stats

Request

  • customerIdstring
    required
  • planIdstring (uuid)
    required

Responses

Format
application/json
Beschreibung

Aggregated token usage statistics for the ai hosting plan.

  • customerIdstring
    required
  • dailyarray of object
    required
    • Array[
      • *object
        • byKeyobject
          required
          • *integer (≥ 0, int64)
        • datestring (date)
          required
        • totalTokensinteger (≥ 0, int64)
          required
      ]
  • keysarray of object
    required

    Every licence of the plan, most used in the timeframe first. Includes licences deleted inside the timeframe, which still carry usage but are no longer returned by the keys endpoint. Ordered, so callers can key chart colours off the position.

    • Array[
      • *object
        • idstring (uuid)
          required
        • namestring
          required
      ]
  • modelSharearray of object
    required
    • Array[
      • *object
        • modelstring
          required
        • tokensinteger (≥ 0, int64)
          required
      ]
  • planIdstring (uuid)
    required
  • timeframeobject
    required
    • endstring (date-time)
      required
    • startstring (date-time)
      required
  • totalTokensinteger (≥ 0, int64)
    required

Usage examples

$ curl \
--fail \
--location \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
https://api.mittwald.de/v2/customers/string/ai-hostings/f0f86186-0a5a-45b2-aa33-502777496347/usage?startDate=1985-10-26T01%3A21%3A00.000Z&endDate=1985-10-26T01%3A21%3A00.000Z&keyId=f0f86186-0a5a-45b2-aa33-502777496347