AI usage log — system description

The log table of AI calls, filters and summary statistics, details and delete operations, and the fact that permission checks use the AI configuration path.

Overview

Log of AI calls. Rows are written by the central AI service and the functions that call the AI; this module only displays and deletes.

Data model

Table names carry the installation's own prefix in the database.

TablePurposeMain fields
aiusageone AI callscope, e-mail identifier, provider, model, tier, input and output tokens, cost estimate, prompt, answer, duration, error

Process

  1. List: filters by scope, provider, action, e-mail identifier, date from–to, failed or not; statistics cards (number of calls, input and output tokens, cost, average time, errors); the page size is fixed to the system's general admin page size.
  2. Details: the full prompt and answer of one call.
  3. Delete: physical deletion of the selected rows.
  4. Delete old: deletes rows older than N days (30 by default).

Permissions

  • Layer 1: the page and the details check access to the AI config path, delete and delete old check its modify permission; the list endpoint checks no permission.
  • Layer 2: debug (SQL of the list). The catalogue key list only drives the visibility of the menu item; the controller does not check it.
  • Layer 3: none.

Known limitations

  • The list endpoint runs without a permission check.
  • The page size cannot be chosen.