Skip to content

Token Usage

If you are an administrator responsible for monitoring AI spend, this page is for you. Token Usage helps you track how much each LLM model is costing your organization by showing consumption broken down by model, day, and month, so you can identify heavy usage patterns, set budgets, and avoid unexpected bills.

The Token Usage page (/token-usage) gives administrators a clear view of how many tokens are being consumed by the LLM integrations: broken down by model, day, and month. This is the primary tool for tracking AI costs and identifying heavy usage patterns.


At the top of the page, a month navigator lets you move forward and backward through calendar months. All cards and tables update instantly when the period changes.

◀ January 2025 ▶

Four cards provide an at-a-glance snapshot of the selected month:

CardDescription
Total RequestsNumber of LLM API calls made during the period
Input TokensTotal tokens sent to the model (prompts, context, system messages)
Output TokensTotal tokens received from the model (generated responses)
Total TokensSum of input + output tokens

Values are displayed in a human-readable format (for example 1.2M, 45K, or 8.3K) rather than raw numbers.


A monthly aggregation table grouping consumption by LLM instance:

ColumnDescription
InstanceThe LLM instance name as configured in Administration
VendorProvider (e.g., OpenAI, Anthropic, Google, Azure, Ollama)
ModelSpecific model identifier (e.g., gpt-4o, claude-3-5-sonnet)
RequestsTotal requests to this instance in the period
InputTotal input tokens for this instance
OutputTotal output tokens for this instance
TotalCombined token count for this instance

Use this table to compare token consumption across different providers and models, and to identify which instances account for the largest share of usage.


A day-by-day table showing consumption per model across the selected month:

ColumnDescription
DateCalendar day
InstanceLLM instance name
VendorProvider
ModelModel identifier
Input TokensTokens sent that day
Output TokensTokens received that day
Total TokensCombined token count for that day
RequestsNumber of requests on that day

Days with no LLM activity do not appear in the table. This breakdown helps spot daily spikes, for example, a batch re-indexing job or a high-traffic event.


Viglet Turing records token usage automatically on every LLM call: no extra configuration is needed.

%%{init: {'theme': 'base', 'themeVariables': {'fontSize': '13px', 'actorBkg': '#dbeafe', 'actorBorder': '#4A90D9', 'actorTextColor': '#1a1a1a', 'activationBkgColor': '#ede9fe', 'activationBorderColor': '#9B6EC5', 'labelBoxBkgColor': '#fef3c7', 'labelBoxBorderColor': '#E8A838', 'labelTextColor': '#1a1a1a', 'noteBkgColor': '#dcfce7', 'noteBorderColor': '#50B86C', 'noteTextColor': '#1a1a1a', 'signalColor': '#333', 'signalTextColor': '#333'}}}%%
sequenceDiagram
participant User
participant API as Chat API
participant LLM as LLM Provider
participant DB as llm_token_usage table
User->>API: Chat request
API->>LLM: Send prompt
LLM-->>API: Response + token metadata
API->>DB: recordUsage()<br/>(instance, vendor, model, username,<br/>input / output / total tokens, timestamp)
API-->>User: Return response

What gets recorded on each call:

FieldDescription
InstanceWhich LLM instance handled the request
VendorProvider name
ModelModel identifier from the response metadata
UsernameThe authenticated user who triggered the call
Input TokensExtracted from the LLM response metadata
Output TokensExtracted from the LLM response metadata
Total TokensInput + output
TimestampDate and time of the request

The same llm_token_usage row also carries a frozen cost_usd plus the originating agent and cost stage (chat.live / chat.background / chat.skill), which is what powers Cost Governance. One table, two views.


Token usage data is also available via the REST API. See REST API Reference → Token Usage API for endpoint details and examples.


PageDescription
Cost GovernanceThe USD-spend layer on top of these token counts
LLM InstancesThe models whose consumption is tracked here
ObservabilityToken/cost metrics in Prometheus + Grafana