Agent Cost

Pro

What each AI agent spent on model calls this period. The total against last period, the budget it eats into, a daily trend and a row per agent with its tokens, its share and the models behind it.

Cost by agent

Nov 1 to Nov 22
$1,486.00
12.4%
Monthly budget
Daily cost by agent
dayAtlasForgeScoutQuillRelay
Nov 17.436.285.824.322.91
Nov 230.3519.7114.359.875.07
Nov 322.72413.899.996.36
Nov 421.9521.9312.389.554.96
Nov 528.9421.7317.839.65.97
Nov 626.6921.311.6410.66.46
Nov 79.72105.654.782.04
Nov 812.110.15.653.763.06
Nov 930.6219.8516.7511.067.61
Nov 1028.0419.6718.978.877.71
Nov 1130.3125.3215.9310.687.78
Nov 1229.9520.0613.319.577.94
Nov 1332.8318.2915.399.577.53
Nov 149.988.045.8242.39
Nov 1510.858.726.154.92.05
Nov 1632.2720.4916.0312.826.01
Nov 1732.4628.115.428.785.47
Nov 1823.1823.9617.2712.765.26
Nov 1932.926.2218.158.777.49
Nov 2029.9428.2515.0310.76.19
Nov 2114.887.488.433.753.24
Nov 2214.318.596.923.612.9
  1. AtlasLead
    $512.4018.2%
  2. ForgeEngineering
    $398.109.6%
  3. ScoutResearch
    $276.804.1%
  4. QuillWriting
    $182.3031.0%
  5. RelaySupport
    $116.4012.5%

Installation#

# One-time setup (tokens + lib helpers)npx koalaui-cli@latest init# Activate your Pro license (once per machine)npx koalaui-cli@latest login <key># Add this component (its dependencies come along)npx koalaui-cli@latest add agent-cost

Usage#

This example is part of Koala UI Pro

The preview is yours to explore. Its code comes with a Pro license, paid once and used in every project.

Have a license? Unlock it here

Anatomy#

import {  AgentCost,  AgentCostHeader,  AgentCostTitle,  AgentCostPeriod,  AgentCostTotal,  AgentCostBudget,  AgentCostChart,  AgentCostList,} from "@/components/ui/agent-cost"<AgentCost>  <AgentCostHeader>    <AgentCostTitle />    <AgentCostPeriod />  </AgentCostHeader>  <AgentCostTotal />  <AgentCostBudget />  <AgentCostChart />  <AgentCostList /></AgentCost>

Budget levels#

The budget stays neutral until warnAt (70%), turns amber there and red from criticalAt (90%). Only the meter changes colour: the rows stay ink, so the agents never compete with the warning. Drag the budget to move between levels.

$1,486.00
12.4%
Monthly budget
Normal at $3,000Warning at $2,000Critical at $1,550

Only the parts you need#

Every part reads the same data from the root, so you render only what the screen needs. A header and the list make a top agents widget; variant="plain" drops the frame when the page already gives it one.

Top agents

This month
  1. AtlasLead
    $512.4018.2%
  2. ForgeEngineering
    $398.109.6%
  3. ScoutResearch
    $276.804.1%
  4. QuillWriting
    $182.3031.0%
  5. RelaySupport
    $116.4012.5%

With Model Cost#

Side by side with Model Cost, the same spend reads both ways: who spent it and on what. Both panels share one anatomy, so their rows, budgets and charts line up.

Cost by agent

Nov 1 to Nov 22
$1,486.00
12.4%
Monthly budget
Daily cost by agent
dayAtlasForgeScoutQuillRelay
Nov 17.436.285.824.322.91
Nov 230.3519.7114.359.875.07
Nov 322.72413.899.996.36
Nov 421.9521.9312.389.554.96
Nov 528.9421.7317.839.65.97
Nov 626.6921.311.6410.66.46
Nov 79.72105.654.782.04
Nov 812.110.15.653.763.06
Nov 930.6219.8516.7511.067.61
Nov 1028.0419.6718.978.877.71
Nov 1130.3125.3215.9310.687.78
Nov 1229.9520.0613.319.577.94
Nov 1332.8318.2915.399.577.53
Nov 149.988.045.8242.39
Nov 1510.858.726.154.92.05
Nov 1632.2720.4916.0312.826.01
Nov 1732.4628.115.428.785.47
Nov 1823.1823.9617.2712.765.26
Nov 1932.926.2218.158.777.49
Nov 2029.9428.2515.0310.76.19
Nov 2114.887.488.433.753.24
Nov 2214.318.596.923.612.9
  1. AtlasLead
    $512.4018.2%
  2. ForgeEngineering
    $398.109.6%
  3. ScoutResearch
    $276.804.1%
  4. QuillWriting
    $182.3031.0%
  5. RelaySupport
    $116.4012.5%

Cost by model

Nov 1 to Nov 22
$1,486.00
12.4%
Monthly budget
Daily cost by model
dayClaude Opus 5.5Claude Sonnet 5.5GPT-5Claude Haiku 5.5Gemini 2.5 Pro
Nov 19.788.113.481.372.01
Nov 232.9826.448.834.964.87
Nov 330.9919.377.133.43.99
Nov 437.418.7911.094.344.86
Nov 527.7228.258.174.654.59
Nov 628.6924.478.814.24.82
Nov 716.7312.374.11.671.5
Nov 816.959.483.171.781.38
Nov 94323.6110.253.785.16
Nov 1040.8126.348.855.675.57
Nov 1132.6233.4112.085.873.66
Nov 1243.7232.618.736.115.47
Nov 1342.6834.119.254.963.95
Nov 1416.269.633.342.172.23
Nov 1511.558.523.852.291.85
Nov 1630.0926.59.034.894.5
Nov 1743.7633.319.334.735.83
Nov 1832.3135.2611.654.195.74
Nov 1935.383213.025.354.29
Nov 2035.4431.948.896.665.28
Nov 2119.6713.275.172.721.66
Nov 2212.6410.94.382.521.99
  1. Claude Opus 5.5Anthropic
    $641.2022.4%
  2. Claude Sonnet 5.5Anthropic
    $498.706.1%
  3. GPT-5OpenAI
    $172.6014.0%
  4. Claude Haiku 5.5Anthropic
    $88.308.3%
  5. Gemini 2.5 ProGoogle
    $85.203.2%

API reference#

AgentCost

The root, a <section> named by its title. It sorts the agents by cost, sums the total and works out the budget level every part reads.

PropTypeDefaultDescription
agents*AgentCostDatum[]-One entry per agent. Order does not matter: rows are sorted by cost.
previousTotalnumber-What the same days cost last period. Drives the trend, whose tooltip names the previous amount.
budgetnumber-The period's spend limit. Without it AgentCostBudget renders nothing.
warnAtnumber0.7Fraction of the budget from which the level turns warning.
criticalAtnumber0.9Fraction of the budget from which the level turns critical.
currencystring"USD"ISO currency for every amount. Formatted in en-US, so server and client agree.
variant"outline" | "plain""outline"outline draws the panel's hairline frame; plain leaves it to the page.
Data attributeDescription
data-levelnormal, warning or critical, when a budget is set.

AgentCostHeader

The title row: title at the start, period at the end.

AgentCostTitle

The panel's <h2>, which names the section. Medium weight, like every app section title.

PropTypeDefaultDescription
infoReact.ReactNode-How the figure is computed, behind an info Toggletip that also opens on touch.
infoLabelstring"About this cost"The info button's accessible name.

AgentCostPeriod

The date range, muted, in tabular figures.

AgentCostTotal

The total as a plain Stat, with an inverted trend against previousTotal: spending more reads as negative. Hover or focus the trend for last period's amount. Children render after the trend.

AgentCostBudget

Spend against budget as a Meter in the level's tone. The amounts and the reset date sit in its tooltip, so the panel keeps one line for it.

PropTypeDefaultDescription
labelReact.ReactNode"Monthly budget"The meter's label.
resetsReact.ReactNode-When the budget starts over, shown in the tooltip.
Data attributeDescription
data-levelnormal, warning or critical.

AgentCostChart

Daily cost as stacked bars, one series per agent on the tonal ramp, biggest agent on the strongest step.

PropTypeDefaultDescription
data*ChartDatum[]-One point per day, a key per agent id.
indexstring"day"The key that names each point.
tickFormatter(value: string | number) => string-How a day is written on the axis.
labelstring"Daily cost by agent"The chart's accessible name and its data table caption.

AgentCostList

One row per agent, kept to two lines: mark, name and cost, then a neutral share bar and the trend. Everything else waits in the row's tooltip: share, tokens in, out and cache, the models the agent used and its effective rate per million.

This example is part of Koala UI Pro

The preview is yours to explore. Its code comes with a Pro license, paid once and used in every project.

Have a license? Unlock it here

FAQ#

Hover or focus the agent's row. After its share and tokens, the tooltip lists the models it called and what each cost, then its effective rate per million tokens, cache included. Pass models on each agent; without it the tooltip shows the rate alone.