Skip to main content

LLM Cost

The LLM Cost screen at app.igrisecurity.com/llm-cost shows spending analytics for all requests processed by the Igris LLM gateway. Cost data is derived from the costCents, tokensIn, tokensOut, model, and provider fields recorded on each llm_call audit event. You need the observe:read permission to open it. See Roles and permissions. If there are no LLM calls in the selected range, the page shows an empty state with a link to create your first LLM connection.

Time range

A segmented control in the page header selects the reporting window: All panels update when the range changes.

Summary KPIs

Two rows of KPI cells appear at the top of the page. Primary metrics: Token metrics:

Spend over time

A stacked bar chart plots daily spend in USD, with each provider as a separate series. The x-axis is date-bucketed by date_trunc('day', timestamp). Hover a bar to see the dollar breakdown per provider for that day. This chart only renders when there is at least one data point in the selected range.

Top models by spend

A horizontal bar chart listing the top 10 models ranked by total costCents. Each bar shows the model identifier and formatted spend. The widest bar represents 100 %; all others are proportional.

Top connections by spend

A horizontal bar chart listing the top 10 connection slugs ranked by total costCents. Useful for identifying which integrations are driving the most spend.

Avg cost per call by connection

A horizontal bar chart ranking connections by their average cost per call (rather than total spend). This surfaces connections that use expensive models infrequently — connections that “Top Connections by Spend” can miss when they are outranked by high-volume, low-cost connections. The label for each bar includes the connection slug and its total call count.

Token usage by model

A horizontal bar chart of combined token consumption (tokensIn + tokensOut) per model. It reuses the same list as Top models by spend, so it covers the top 10 models by spend, not the top 10 by tokens. A heavy but cheap model can be missing.

API

Both routes need observe:read. They live under /api/v1/observe/llm-cost. range accepts 24h, 7d, 30d, or 90d. Any other value falls back to a 7-day window. Both routes only count llm_call events. Responses are wrapped in { "data": ... }.

Summary response shape

Each ranking returns at most 10 entries. topUsers is filled from the end-user ID your requests send in X-Igris-User, so it is null for calls without one. The dashboard does not chart it.

Timeseries response shape