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.

Time range

A segmented control in the page header selects the reporting window:
OptionWindow
24hLast 24 hours
7dLast 7 days (default)
30dLast 30 days
90dLast 90 days
All panels update when the range changes.

Summary KPIs

Two rows of KPI cells appear at the top of the page. Primary metrics:
KPIDescription
Total SpendSum of costCents across all LLM calls in the period, displayed in USD
Avg Cost/CalltotalCents ÷ totalCalls
Total CallsCount of llm_call audit events in the period
Active ProvidersNumber of distinct providers with at least one call
Token metrics:
KPIDescription
Input TokensSum of tokensIn
Output TokensSum of tokensOut
Avg Tokens/Call(totalTokensIn + totalTokensOut) ÷ totalCalls

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 ranking models by combined token consumption (tokensIn + tokensOut). Helps identify which models are the largest token consumers regardless of unit price.

API

MethodPathDescription
GET/api/v1/llm-cost/summary?range=7dAggregated totals, top models, top connections, avg-cost ranking
GET/api/v1/llm-cost/timeseries?range=7dDaily spend per provider for the stacked bar chart
range accepts 24h, 7d, 30d, or 90d. Defaults to 7d.

Summary response shape

{
  "totalCents": 1234,
  "totalCalls": 980,
  "totalTokensIn": 450000,
  "totalTokensOut": 120000,
  "topModels": [
    { "model": "claude-3-5-sonnet-20241022", "cents": 800, "calls": 600, "tokensIn": 300000, "tokensOut": 80000 }
  ],
  "topConnections": [
    { "slug": "prod-gateway", "cents": 950, "calls": 750 }
  ],
  "connectionsByAvgCost": [
    { "slug": "premium-agent", "avgCents": 42.5, "calls": 12 }
  ],
  "range": "7d"
}

Timeseries response shape

[
  { "date": "2026-06-20T00:00:00.000Z", "provider": "anthropic", "cents": 120, "calls": 90 },
  { "date": "2026-06-20T00:00:00.000Z", "provider": "openai", "cents": 45, "calls": 30 }
]