AI usage: requests, tokens, costs and the journal
Describes AI 0.29.1.
Every AI call the site makes, from any module, is written to the AI journal. The Usage page shows the totals and each request with what was sent, what came back and what it cost.
Where to find it
In the admin sidebar, open AI, then Usage (/admin/ai/usage). It needs the See AI usage permission, because it shows every request’s prompt and answer. Without it the tab is hidden, and opening the address sends you to the endpoint list with You don’t have permission to see AI usage.
AI usage: what was asked, at what cost.
The totals
The top card has three columns, for today, the last 30 days and all time: Requests / Tokens, Successful / Errors and Avg Latency. Once old entries may have been deleted by the retention periods, a note says the totals are For the retained period, since a date.
Recent Requests
The list is filtered by date, Last 7 Days to start with. The other choices are Today, Last 30 Days and All Time. Filters by endpoint (All Endpoints), model (All Models), status (All Statuses) and source (All Sources) appear when there is more than one value to choose from. Clear resets them.
Each row shows the Time, Endpoint, Prompt (a link to it when the prompt still exists), Model, Tokens, Latency, Price, Status and Source. Some columns appear only on wider screens. Click a header to sort.
- Model: when a different model answered than the one asked for, it shows “answered by” that model under it.
- Price: a small badge says when the cost was worked out here rather than reported by the provider: entered by hand (the price on the endpoint) or list price (a built-in list, which may be out of date).
- Status: Success, Error, Timeout or Refused. A refused request was stopped before it reached the provider, for example by a limit or because the model lacks what its task needs. An icon next to an error shows its message on hover.
The count above the table says how many requests of how many are shown. Load More adds the next batch.
A request’s details
The eye button opens Request Details:
- ID, Status, Latency and Cost.
- Endpoint, Prompt and Model.
- Input Tokens, Output Tokens and Total Tokens, and the Timestamp (UTC).
- Error Message, when the call failed.
- Request Messages (or Input for speech calls) and the Response. For reasoning models, the chain of thought sits folded under Reasoning.
- Parameters, Source, Caller Context (request ID, node, PID, memory) and, folded, Stacktrace, Request Payload (sent to API), API Response (raw) and Database Record.
If the content was removed by the retention period, a note says so and when. Images, files and audio in a message are shown as placeholders: the journal doesn’t store them.
Journal retention
The Journal retention card sets how long the journal is kept. By default nothing is deleted. There are three periods:
- Content of journal entries: prompts, answers and reasoning are removed; the entry, its cost and tokens stay. The content of the last 24 hours is never removed.
- Journal entries: the whole entry is deleted, with its cost.
- Guard events: flags, blocks and forgiven limits of the AI guard.
For each, tick Keep forever or give a number and a unit (days, months, years), then Save periods. A period is applied by the nightly cleanup, no earlier than a day after you save it. Saving a shorter period asks you to confirm in Save a shorter period, and warnings appear under a period, for example when entries before a date will be deleted and there will be nothing to check the provider’s invoice against.
The card’s status lines show whether automatic cleanup is off, when the last nightly and manual cleanups ran, and whether one failed.
Clean up now runs a cleanup by hand. For each kind choose Leave as it is, By the saved period or Older than… with a value for this run only, press Count to see what would go, then Delete and confirm in Clean up the journal now.
Changing the periods or cleaning up needs the Manage the AI task guard permission. Without it the card is marked Read only and shows the saved periods.
What it doesn’t do
- Clearing the content keeps an entry’s error message, which may quote the provider’s answer. It leaves only with the entry.
- The reasons and notes of blocks aren’t covered by the retention periods.
- There is no export from this page.