# AiUsageCost

> AI spend overview with total, token, billed, unbilled and marked-up client price tiles, a daily stacked cost chart and a by-model, product or run breakdown with token columns, plus a TokenCostMeter for one run.

Source: https://docs.nasaqui.com/components/ai-usage-cost

## Install

```bash
npx shadcn@latest add https://docs.nasaqui.com/r/ai-usage-cost.json
```

What the AI features cost. Tiles give the total, the tokens, what has been billed, what is still unbilled and, when you pass a `markup`, the price the client pays. A stacked daily chart splits billed from unbilled spend. Tabs break the cost down by model, product or run, each with input and output token columns. `TokenCostMeter` shows one run: its input, cached and output tokens and, optionally, its spend against a budget.

## When to use

- A billing or admin screen that reports AI spend to an owner or an agency.
- A run detail that needs its token split and budget.

## When not to use

- Plan quotas and limits: use [`UsageMeter`](https://docs.nasaqui.com/components/usage-meter).
- General analytics with no cost or token idea: use [`BreakdownTable`](https://docs.nasaqui.com/components/breakdown-table) or [`TimeSeriesPanel`](https://docs.nasaqui.com/components/time-series-panel).

## Import

```tsx
import { AiUsageCost, TokenCostMeter } from "@fadymondy/nasaq/web";
```

## Quick start

```tsx
import { AiUsageCost } from "@fadymondy/nasaq/web";

export function Costs() {
  return (
    <AiUsageCost
      currency="USD"
      markup={0.2}
      days={[
        { date: "2026-09-28", billed: 12.4, unbilled: 0 },
        { date: "2026-09-29", billed: 0, unbilled: 9.1 },
      ]}
      byModel={[{ id: "opus", label: "Opus 5.5", tokensIn: 2_400_000, tokensOut: 310_000, cost: 21.5 }]}
    />
  );
}
```

## Anatomy

```
AiUsageCost        data-slot="ai-usage-cost"
  StatGrid         total, tokens, billed, unbilled, client price
  Card + BarChart  stacked billed / unbilled per day
  Tabs             By model | By product | By run  (only tabs that have rows)
    BreakdownTable cost, share, change, In and Out token columns
TokenCostMeter     data-slot="token-cost-meter"
```

## API

### AiUsageCost

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `days` | `AiCostDay[]` | required | `{ date: "YYYY-MM-DD", billed, unbilled }`, oldest first. |
| `byModel` / `byProduct` / `byRun` | `AiCostRow[]` | none | `{ id, label, tokensIn, tokensOut, cost, previous? }`. A tab appears for each one given. |
| `markup` | `number` | none | Fraction over provider cost (0.2 is +20%). Adds the client price tile. |
| `previousTotal` | `number` | none | Adds the change on the total tile (a rise is the bad tone). |
| `currency` | `string` | `"USD"` (`"SAR"` in Arabic) | ISO 4217 code. |
| `loading` | `boolean` | `false` | Skeletons in tiles and tables. |
| `labels` | `AiUsageCostLabels` | en / ar | Override any string. |

### TokenCostMeter

`tokensIn`, `tokensOut`, `cached` (part of `tokensIn`), `cost`, `budget` (`number` or `null` for none; with `cost` it adds a `UsageMeter` in money), `currency`, `labels`.

Pure helpers `costTotals`, `withMarkup`, `sumTokens`, `tokenSplit`, `costPerMillion` and `totalTokens` are exported for reports and tests.

## Examples

A run with a budget:

```tsx
import { TokenCostMeter } from "@fadymondy/nasaq/web";

export const Run = () => <TokenCostMeter tokensIn={182_000} tokensOut={24_000} cached={120_000} cost={1.42} budget={2} />;
```

Arabic: use `NasaqProvider locale="ar"`. Model and run names stay left to right; the chart axis mirrors.

## Accessibility

The chart has a text name and the same data is in the breakdown tables. The token split bar is an image with a spoken summary and a visible legend with numbers. Trend on cost is text and an arrow, never colour alone.

## RTL & i18n

- Logical properties; the chart axes reverse in Arabic.
- Money and token counts use the active locale with Latin digits by default; row labels are `dir="ltr"`.
- Every string has an English and Arabic default.

## Styling & tokens

- Billed uses `--primary`, unbilled `--nq-warning`; the token bar adds `--nq-info` for cached.
- Target `[data-slot="ai-usage-cost"]` or `[data-slot="token-cost-meter"]`.

## Do / Don't

- Do show billed and unbilled together; unbilled is what surprises people.
- Do pass `previousTotal` so the total has context.
- Don't put vendor logos in the label; names are text.

## Related

- [`UsageMeter`](https://docs.nasaqui.com/components/usage-meter)
- [`BreakdownTable`](https://docs.nasaqui.com/components/breakdown-table)
- [`ModelRoutingEditor`](https://docs.nasaqui.com/components/model-routing-editor)

## Lab

https://docs.nasaqui.com/?path=/docs/components-ai-agents-ai-usage-cost--docs

## Code

### React

```tsx
import { AiUsageCost } from "@fadymondy/nasaq/web";

export function Costs() {
  return (
    <AiUsageCost
      currency="USD"
      markup={0.2}
      days={[
        { date: "2026-09-28", billed: 12.4, unbilled: 0 },
        { date: "2026-09-29", billed: 0, unbilled: 9.1 },
      ]}
      byModel={[{ id: "opus", label: "Opus 5.5", tokensIn: 2_400_000, tokensOut: 310_000, cost: 21.5 }]}
    />
  );
}
```

### shadcn

```tsx
import { AiUsageCost } from "@/components/ui/ai-usage-cost";

export function Costs() {
  return (
    <AiUsageCost
      currency="USD"
      markup={0.2}
      days={[
        { date: "2026-09-28", billed: 12.4, unbilled: 0 },
        { date: "2026-09-29", billed: 0, unbilled: 9.1 },
      ]}
      byModel={[{ id: "opus", label: "Opus 5.5", tokensIn: 2_400_000, tokensOut: 310_000, cost: 21.5 }]}
    />
  );
}
```

### Vue

```vue
<script setup lang="ts">
import { NqAiUsageCost, NqTokenCostMeter } from "@fadymondy/nasaq/vue";

const days = [
  { date: "2026-09-26", billed: 8.2, unbilled: 0 },
  { date: "2026-09-27", billed: 12.4, unbilled: 0 },
  { date: "2026-09-28", billed: 3.1, unbilled: 5.6 },
  { date: "2026-09-29", billed: 0, unbilled: 9.1 },
];
const byModel = [
  { id: "opus", label: "Opus 5.5", tokensIn: 2_400_000, tokensOut: 310_000, cost: 21.5, previous: 18.2 },
  { id: "sonnet", label: "Sonnet 5.5", tokensIn: 5_100_000, tokensOut: 720_000, cost: 12.9, previous: 14.1 },
  { id: "haiku", label: "Haiku 4.5", tokensIn: 3_800_000, tokensOut: 410_000, cost: 3.4 },
];
</script>

<template>
  <div class="flex w-full max-w-4xl flex-col gap-8">
    <NqAiUsageCost :days="days" :by-model="byModel" :markup="0.2" :previous-total="30" />
    <NqTokenCostMeter :tokens-in="182000" :tokens-out="24000" :cached="120000" :cost="1.42" :budget="2" class="max-w-md" />
  </div>
</template>
```

### Blade

```blade
<div class="flex w-full max-w-4xl flex-col gap-8">
    <x-nq::ai-usage-cost
        :markup="0.2"
        :previous-total="30"
        :days="[
            ['date' => '2026-09-26', 'billed' => 8.2, 'unbilled' => 0],
            ['date' => '2026-09-27', 'billed' => 12.4, 'unbilled' => 0],
            ['date' => '2026-09-28', 'billed' => 3.1, 'unbilled' => 5.6],
            ['date' => '2026-09-29', 'billed' => 0, 'unbilled' => 9.1],
        ]"
        :by-model="[
            ['id' => 'opus', 'label' => 'Opus 5.5', 'tokensIn' => 2400000, 'tokensOut' => 310000, 'cost' => 21.5, 'previous' => 18.2],
            ['id' => 'sonnet', 'label' => 'Sonnet 5.5', 'tokensIn' => 5100000, 'tokensOut' => 720000, 'cost' => 12.9, 'previous' => 14.1],
            ['id' => 'haiku', 'label' => 'Haiku 4.5', 'tokensIn' => 3800000, 'tokensOut' => 410000, 'cost' => 3.4],
        ]" />
    <x-nq::ai-usage-cost.token-meter :tokens-in="182000" :tokens-out="24000" :cached="120000" :cost="1.42" :budget="2" class="max-w-md" />
</div>
```

### HTML + Alpine

```html
<div class="flex w-full max-w-4xl flex-col gap-8">
    <div data-slot="ai-usage-cost" class="flex min-w-0 flex-col gap-4">
    <div data-slot="stat-grid" class="grid grid-cols-[repeat(auto-fit,minmax(min(100%,14rem),1fr))] gap-3"><div data-slot="stat-card"  data-trend="up" data-tone="negative"   class="flex flex-col gap-3 rounded-card border border-border bg-card px-4 py-4 text-card-foreground">
            <div class="flex items-center gap-2">
                            <span data-slot="stat-card-icon" aria-hidden="true" class="grid size-8 shrink-0 place-items-center rounded-control bg-secondary text-muted-foreground [&_svg]:size-4"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  <path d="M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1"/>
  <path d="M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4"/>
</svg></span>
                        <div data-slot="stat-card-label" class="min-w-0 truncate text-body-sm text-muted-foreground">Total cost</div>
        </div>
        <div class="flex items-end justify-between gap-3">
            <div class="flex min-w-0 flex-col gap-1">
                <div data-slot="stat-card-value" class="text-h2 leading-tight text-foreground tabular-nums">
                                            <bdi data-slot="num" data-numeric="" class="tabular-nums">$38</bdi>
                                    </div>
                                    <div data-slot="stat-card-delta" class="flex flex-wrap items-center gap-x-1.5 text-caption">
                        <span class="inline-flex items-center gap-1 text-label text-nq-danger-text">
                            <svg aria-hidden="true" class="size-3.5 shrink-0 rtl:-scale-x-100" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  <path d="M16 7h6v6"/>
  <path d="m22 7-8.5 8.5-5-5L2 17"/>
</svg>                            <bdi data-slot="num" data-numeric="" class="tabular-nums">+28%</bdi>
                        </span>
                        <span class="text-muted-foreground">vs previous period</span>                    </div>
                            </div>
                    </div>
    </div>
        <div data-slot="stat-card"   class="flex flex-col gap-3 rounded-card border border-border bg-card px-4 py-4 text-card-foreground">
            <div class="flex items-center gap-2">
                            <span data-slot="stat-card-icon" aria-hidden="true" class="grid size-8 shrink-0 place-items-center rounded-control bg-secondary text-muted-foreground [&_svg]:size-4"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  <path d="M12 20v2"/>
  <path d="M12 2v2"/>
  <path d="M17 20v2"/>
  <path d="M17 2v2"/>
  <path d="M2 12h2"/>
  <path d="M2 17h2"/>
  <path d="M2 7h2"/>
  <path d="M20 12h2"/>
  <path d="M20 17h2"/>
  <path d="M20 7h2"/>
  <path d="M7 20v2"/>
  <path d="M7 2v2"/>
  <rect x="4" y="4" width="16" height="16" rx="2"/>
  <rect x="8" y="8" width="8" height="8" rx="1"/>
</svg></span>
                        <div data-slot="stat-card-label" class="min-w-0 truncate text-body-sm text-muted-foreground">Tokens</div>
        </div>
        <div class="flex items-end justify-between gap-3">
            <div class="flex min-w-0 flex-col gap-1">
                <div data-slot="stat-card-value" class="text-h2 leading-tight text-foreground tabular-nums">
                                            <bdi data-slot="num" data-numeric="" class="tabular-nums">12.7M</bdi>
                                    </div>
                            </div>
                    </div>
    </div>
        <div data-slot="stat-card"   class="flex flex-col gap-3 rounded-card border border-border bg-card px-4 py-4 text-card-foreground">
            <div class="flex items-center gap-2">
                            <span data-slot="stat-card-icon" aria-hidden="true" class="grid size-8 shrink-0 place-items-center rounded-control bg-secondary text-muted-foreground [&_svg]:size-4"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  <path d="M13 16H8"/>
  <path d="M14 8H8"/>
  <path d="M16 12H8"/>
  <path d="M4 3a1 1 0 0 1 1-1 1.3 1.3 0 0 1 .7.2l.933.6a1.3 1.3 0 0 0 1.4 0l.934-.6a1.3 1.3 0 0 1 1.4 0l.933.6a1.3 1.3 0 0 0 1.4 0l.933-.6a1.3 1.3 0 0 1 1.4 0l.934.6a1.3 1.3 0 0 0 1.4 0l.933-.6A1.3 1.3 0 0 1 19 2a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1 1.3 1.3 0 0 1-.7-.2l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.934.6a1.3 1.3 0 0 1-1.4 0l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-1.4 0l-.934-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-.7.2 1 1 0 0 1-1-1z"/>
</svg></span>
                        <div data-slot="stat-card-label" class="min-w-0 truncate text-body-sm text-muted-foreground">Billed</div>
        </div>
        <div class="flex items-end justify-between gap-3">
            <div class="flex min-w-0 flex-col gap-1">
                <div data-slot="stat-card-value" class="text-h2 leading-tight text-foreground tabular-nums">
                                            <bdi data-slot="num" data-numeric="" class="tabular-nums">$23.70</bdi>
                                    </div>
                            </div>
                    </div>
    </div>
        <div data-slot="stat-card"   class="flex flex-col gap-3 rounded-card border border-border bg-card px-4 py-4 text-card-foreground">
            <div class="flex items-center gap-2">
                            <span data-slot="stat-card-icon" aria-hidden="true" class="grid size-8 shrink-0 place-items-center rounded-control bg-secondary text-muted-foreground [&_svg]:size-4"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  <path d="M13.744 17.736a6 6 0 1 1-7.48-7.48"/>
  <path d="M15 6h1v4"/>
  <path d="m6.134 14.768.866-.5 2 3.464"/>
  <circle cx="16" cy="8" r="6"/>
</svg></span>
                        <div data-slot="stat-card-label" class="min-w-0 truncate text-body-sm text-muted-foreground">Unbilled</div>
        </div>
        <div class="flex items-end justify-between gap-3">
            <div class="flex min-w-0 flex-col gap-1">
                <div data-slot="stat-card-value" class="text-h2 leading-tight text-foreground tabular-nums">
                                            <bdi data-slot="num" data-numeric="" class="tabular-nums">$14.70</bdi>
                                    </div>
                            </div>
                    </div>
    </div>
                    <div data-slot="stat-card"   class="flex flex-col gap-3 rounded-card border border-border bg-card px-4 py-4 text-card-foreground">
            <div class="flex items-center gap-2">
                            <span data-slot="stat-card-icon" aria-hidden="true" class="grid size-8 shrink-0 place-items-center rounded-control bg-secondary text-muted-foreground [&_svg]:size-4"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  <path d="M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z"/>
  <path d="M20 2v4"/>
  <path d="M22 4h-4"/>
  <circle cx="4" cy="20" r="2"/>
</svg></span>
                        <div data-slot="stat-card-label" class="min-w-0 truncate text-body-sm text-muted-foreground">Client price (+20%)</div>
        </div>
        <div class="flex items-end justify-between gap-3">
            <div class="flex min-w-0 flex-col gap-1">
                <div data-slot="stat-card-value" class="text-h2 leading-tight text-foreground tabular-nums">
                                            <bdi data-slot="num" data-numeric="" class="tabular-nums">$46.08</bdi>
                                    </div>
                            </div>
                    </div>
    </div></div>
    <div data-slot="card" class="flex flex-col gap-4 rounded-card border border-border bg-card py-4 text-card-foreground"><div data-slot="card-header" class="grid auto-rows-min items-start gap-1 px-4 has-data-[slot=card-action]:grid-cols-[1fr_auto]"><h3 data-slot="card-title" class="text-foreground text-h3">Cost per day</h3>
            <div data-slot="card-description" class="text-body-sm text-muted-foreground">Billed and unbilled spend, by day</div></div>
        <div data-slot="card-content" class="px-4"><div data-slot="chart"  role="img" aria-label="Cost per day. Daily cost, 4 days"   style="--color-billed: var(--primary); --color-unbilled: var(--nq-warning)"     class="flex w-full text-caption [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line]:stroke-border [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-dot]:stroke-card [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector]:stroke-card [&_.recharts-surface]:outline-hidden aspect-auto h-52 flex-col justify-start gap-2">
    <div class="flex min-h-0 flex-1 gap-2">
                    <div aria-hidden="true" class="flex w-12 shrink-0 flex-col justify-between text-end text-muted-foreground tabular-nums">
                        <span>$12</span>
                        <span>$0</span>
                    </div>
                    <div class="flex min-w-0 flex-1 items-end gap-1 border-b border-border bg-[linear-gradient(to_bottom,var(--border)_1px,transparent_1px)] bg-[length:100%_50%]">
                                                    <div data-slot="chart-bar" title="Sep 26: Billed $8.20, Unbilled $0.00" class="flex h-full min-w-0 flex-1 flex-col-reverse justify-start">
                                <span class="block w-full" style="height: 66.129%; background-color: var(--color-billed)"></span>
                                <span class="block w-full rounded-t-[3px]" style="height: 0%; background-color: var(--color-unbilled)"></span>
                            </div>
                                                    <div data-slot="chart-bar" title="Sep 27: Billed $12.40, Unbilled $0.00" class="flex h-full min-w-0 flex-1 flex-col-reverse justify-start">
                                <span class="block w-full" style="height: 100%; background-color: var(--color-billed)"></span>
                                <span class="block w-full rounded-t-[3px]" style="height: 0%; background-color: var(--color-unbilled)"></span>
                            </div>
                                                    <div data-slot="chart-bar" title="Sep 28: Billed $3.10, Unbilled $5.60" class="flex h-full min-w-0 flex-1 flex-col-reverse justify-start">
                                <span class="block w-full" style="height: 25%; background-color: var(--color-billed)"></span>
                                <span class="block w-full rounded-t-[3px]" style="height: 45.1613%; background-color: var(--color-unbilled)"></span>
                            </div>
                                                    <div data-slot="chart-bar" title="Sep 29: Billed $0.00, Unbilled $9.10" class="flex h-full min-w-0 flex-1 flex-col-reverse justify-start">
                                <span class="block w-full" style="height: 0%; background-color: var(--color-billed)"></span>
                                <span class="block w-full rounded-t-[3px]" style="height: 73.3871%; background-color: var(--color-unbilled)"></span>
                            </div>
                                            </div>
                </div>
                <div aria-hidden="true" class="flex justify-between ps-14 text-muted-foreground"><span>Sep 26</span><span>Sep 29</span></div>
                <ul data-slot="chart-legend" class="flex flex-wrap items-center justify-center gap-x-4 gap-y-1 pt-3 text-caption">
                                <li class="flex items-center gap-1.5 text-muted-foreground">
                <span aria-hidden="true" class="size-2.5 shrink-0 rounded-[2px]"  style="background-color: var(--color-billed)" ></span>
                Billed
            </li>
                                <li class="flex items-center gap-1.5 text-muted-foreground">
                <span aria-hidden="true" class="size-2.5 shrink-0 rounded-[2px]"  style="background-color: var(--color-unbilled)" ></span>
                Unbilled
            </li>
            </ul>
</div></div></div>
            <div data-slot="tabs" data-orientation="horizontal" x-data="nqTabs('model')" x-modelable="value" x-id="['nq-tabs']" class="flex flex-col gap-4">
    <div data-slot="tabs-list" data-variant="segmented" aria-orientation="horizontal" x-bind="list"
    aria-label="Cost breakdown" class="relative z-0 flex max-w-full overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden w-fit gap-0.5 rounded-control bg-secondary p-0.5">
    <button type="button" data-slot="tabs-tab" x-bind="tab('model')"
     data-active aria-selected="true"         class="inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap text-label text-muted-foreground outline-none transition-colors duration-150 ease-nq hover:text-foreground data-active:text-foreground [&_svg]:size-4 [&_svg]:shrink-0 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-nq-focus data-disabled:pointer-events-none data-disabled:opacity-50 h-7 rounded-[calc(var(--radius-control)-2px)] px-3">By model</button>
</div>
                                            <div data-slot="tabs-panel" x-bind="panel('model')"
        class="outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-nq-focus pt-3"><div data-slot="breakdown-table"      class="flex flex-col gap-4 rounded-card border border-border bg-card py-4 text-card-foreground">
        <div data-slot="card-content" class="px-0"><div data-slot="table-container" role="region" tabindex="0"  aria-label="Cost breakdown: By model"     class="relative w-full overflow-x-auto outline-none focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-nq-focus">
    <table data-slot="table" data-density="default"
                  class="w-full caption-bottom border-collapse text-body-sm">
        <thead data-slot="table-header" class="[&_tr]:border-b [&_tr]:hover:bg-transparent [&_tr]:even:bg-transparent"><tr data-slot="table-row"     class="border-b border-border transition-colors duration-150 ease-nq hover:bg-nq-hover data-[state=selected]:bg-nq-selected"><th data-slot="table-head" scope="col" class="h-row text-start align-middle text-caption font-medium whitespace-nowrap text-muted-foreground px-4 py-3">Model</th>
                        <th data-slot="table-head" scope="col" class="h-row align-middle text-caption font-medium whitespace-nowrap text-muted-foreground px-4 py-3 text-end">Cost</th>
                        <th data-slot="table-head" scope="col" class="h-row align-middle text-caption font-medium whitespace-nowrap text-muted-foreground px-4 py-3 hidden text-end sm:table-cell">Share</th>
                        <th data-slot="table-head" scope="col" class="h-row align-middle text-caption font-medium whitespace-nowrap text-muted-foreground px-4 py-3 text-end">Change</th>
                                                    <th data-slot="table-head" scope="col" class="h-row align-middle text-caption font-medium whitespace-nowrap text-muted-foreground px-4 py-3 text-end">In</th>
                                                    <th data-slot="table-head" scope="col" class="h-row align-middle text-caption font-medium whitespace-nowrap text-muted-foreground px-4 py-3 text-end">Out</th></tr></thead>
                <tbody data-slot="table-body" class="[&_tr:last-child]:border-0"><tr data-slot="table-row"     data-row="opus" class="border-b border-border transition-colors duration-150 ease-nq hover:bg-nq-hover data-[state=selected]:bg-nq-selected"><td data-slot="table-cell" class="h-row align-middle whitespace-nowrap px-4 py-3 min-w-40 max-w-0 sm:min-w-56"><bdi dir="ltr" class="block truncate">Opus 5.5</bdi>
                                                                                                <span aria-hidden="true" data-slot="breakdown-bar" class="mt-1.5 block h-1.5 rounded-full bg-nq-surface-soft">
                                    <span class="block h-full rounded-full bg-[var(--bar)]" style="--bar: var(--primary); width: 100%"></span>
                                </span></td>
                            <td data-slot="table-cell" class="h-row align-middle whitespace-nowrap px-4 py-3 text-end tabular-nums"><bdi data-slot="num" data-numeric="" class="tabular-nums">$21.50</bdi></td>
                                                            <td data-slot="table-cell" class="h-row align-middle whitespace-nowrap px-4 py-3 hidden text-end tabular-nums text-muted-foreground sm:table-cell"><bdi data-slot="num" data-numeric="" class="tabular-nums">56.9%</bdi></td>
                                                                                        <td data-slot="table-cell" class="h-row align-middle whitespace-nowrap px-4 py-3 text-end tabular-nums text-nq-danger-text"><bdi data-slot="num" data-numeric="">+18.1%</bdi></td>
                                                                                        <td data-slot="table-cell" class="h-row align-middle whitespace-nowrap px-4 py-3 text-end tabular-nums">2.4M</td>
                                                            <td data-slot="table-cell" class="h-row align-middle whitespace-nowrap px-4 py-3 text-end tabular-nums">310K</td></tr>
                                                                    <tr data-slot="table-row"     data-row="sonnet" class="border-b border-border transition-colors duration-150 ease-nq hover:bg-nq-hover data-[state=selected]:bg-nq-selected"><td data-slot="table-cell" class="h-row align-middle whitespace-nowrap px-4 py-3 min-w-40 max-w-0 sm:min-w-56"><bdi dir="ltr" class="block truncate">Sonnet 5.5</bdi>
                                                                                                <span aria-hidden="true" data-slot="breakdown-bar" class="mt-1.5 block h-1.5 rounded-full bg-nq-surface-soft">
                                    <span class="block h-full rounded-full bg-[var(--bar)]" style="--bar: var(--primary); width: 60%"></span>
                                </span></td>
                            <td data-slot="table-cell" class="h-row align-middle whitespace-nowrap px-4 py-3 text-end tabular-nums"><bdi data-slot="num" data-numeric="" class="tabular-nums">$12.90</bdi></td>
                                                            <td data-slot="table-cell" class="h-row align-middle whitespace-nowrap px-4 py-3 hidden text-end tabular-nums text-muted-foreground sm:table-cell"><bdi data-slot="num" data-numeric="" class="tabular-nums">34.1%</bdi></td>
                                                                                        <td data-slot="table-cell" class="h-row align-middle whitespace-nowrap px-4 py-3 text-end tabular-nums text-nq-success-text"><bdi data-slot="num" data-numeric="">-8.5%</bdi></td>
                                                                                        <td data-slot="table-cell" class="h-row align-middle whitespace-nowrap px-4 py-3 text-end tabular-nums">5.1M</td>
                                                            <td data-slot="table-cell" class="h-row align-middle whitespace-nowrap px-4 py-3 text-end tabular-nums">720K</td></tr>
                                                                    <tr data-slot="table-row"     data-row="haiku" class="border-b border-border transition-colors duration-150 ease-nq hover:bg-nq-hover data-[state=selected]:bg-nq-selected"><td data-slot="table-cell" class="h-row align-middle whitespace-nowrap px-4 py-3 min-w-40 max-w-0 sm:min-w-56"><bdi dir="ltr" class="block truncate">Haiku 4.5</bdi>
                                                                                                <span aria-hidden="true" data-slot="breakdown-bar" class="mt-1.5 block h-1.5 rounded-full bg-nq-surface-soft">
                                    <span class="block h-full rounded-full bg-[var(--bar)]" style="--bar: var(--primary); width: 15.814%"></span>
                                </span></td>
                            <td data-slot="table-cell" class="h-row align-middle whitespace-nowrap px-4 py-3 text-end tabular-nums"><bdi data-slot="num" data-numeric="" class="tabular-nums">$3.40</bdi></td>
                                                            <td data-slot="table-cell" class="h-row align-middle whitespace-nowrap px-4 py-3 hidden text-end tabular-nums text-muted-foreground sm:table-cell"><bdi data-slot="num" data-numeric="" class="tabular-nums">9%</bdi></td>
                                                                                        <td data-slot="table-cell" class="h-row align-middle whitespace-nowrap px-4 py-3 text-end tabular-nums text-muted-foreground">–</td>
                                                                                        <td data-slot="table-cell" class="h-row align-middle whitespace-nowrap px-4 py-3 text-end tabular-nums">3.8M</td>
                                                            <td data-slot="table-cell" class="h-row align-middle whitespace-nowrap px-4 py-3 text-end tabular-nums">410K</td></tr></tbody>
    </table>
</div></div>
</div></div>
</div>
    </div>
    <div data-slot="token-cost-meter" class="flex min-w-0 flex-col gap-3 max-w-md">
    <div class="flex items-baseline justify-between gap-3 text-body-sm">
        <span class="text-label text-foreground">Token split</span>
        <bdi class="text-muted-foreground tabular-nums">206K tokens</bdi>
    </div>
    <div role="img" aria-label="Input 62K, Cached 120K, Output 24K" class="flex h-2 overflow-hidden rounded-full bg-nq-surface-soft" dir="ltr">
                    <span class="h-full" style="width: 30.0971%; background: var(--primary)"></span>                    <span class="h-full" style="width: 58.2524%; background: var(--nq-info)"></span>                    <span class="h-full" style="width: 11.6505%; background: var(--nq-warning)"></span>            </div>
    <ul class="flex flex-wrap gap-x-4 gap-y-1 text-caption text-muted-foreground">
                    <li class="flex items-center gap-1.5">
                <span aria-hidden="true" class="size-2 rounded-full" style="background: var(--primary)"></span>
                Input
                <bdi class="text-foreground tabular-nums">62K</bdi>
            </li>
                    <li class="flex items-center gap-1.5">
                <span aria-hidden="true" class="size-2 rounded-full" style="background: var(--nq-info)"></span>
                Cached
                <bdi class="text-foreground tabular-nums">120K</bdi>
            </li>
                    <li class="flex items-center gap-1.5">
                <span aria-hidden="true" class="size-2 rounded-full" style="background: var(--nq-warning)"></span>
                Output
                <bdi class="text-foreground tabular-nums">24K</bdi>
            </li>
            </ul>
            <div data-slot="usage-meter" data-tone="ok"  class="flex min-w-0 flex-col gap-1.5">
    <div class="flex items-baseline justify-between gap-3 text-body-sm">
        <span data-slot="usage-meter-label" class="min-w-0 truncate text-label text-foreground">Run budget</span>
        <span data-slot="usage-meter-value" class="shrink-0 text-muted-foreground tabular-nums"><bdi class="text-foreground">$1.42</bdi> of <bdi>$2</bdi></span>
    </div>
            <div class="relative">
            <div data-slot="meter" data-tone="default" role="meter"     aria-valuemin="0" aria-valuemax="2" aria-valuenow="1.42" aria-valuetext="1%"
    aria-label="Run budget" class="flex w-full flex-col gap-1.5">
        <div data-slot="meter-track" class="relative block w-full overflow-hidden rounded-full bg-nq-surface-soft h-1">
        <div data-slot="meter-indicator" style="inset-inline-start:0;width:71%" class="block h-full rounded-full transition-[width] duration-300 ease-nq motion-reduce:transition-none bg-primary"></div>
    </div>
</div>
                    </div>
                    <div class="flex flex-wrap items-center justify-between gap-x-3 text-caption text-muted-foreground">
                                    <span></span>
                                                    <span>$0.58 left</span>
                            </div>
            </div>
    </div>
</div>
```
