ValyroUI Русская версия

Token Usage

Token spend display. Pro · AI chat and agents › Tokens and context

Installation

npx valyro-cli@latest login
npx valyro-cli@latest add token-usage
npm install valyro-ui-pro

import 'valyro-ui-pro/styles.css';
import { TokenUsage } from 'valyro-ui-pro';

Props

PropTypeDefault
input *numberUncached prompt tokens.
output *numberGenerated completion tokens.
cachednumber0Prompt tokens served from the cache.
costnumberTotal cost in currency.
currencystring'USD'ISO 4217 code. Default USD.
localestringBCP 47 locale for numbers and the cost; defaults to the ThemeProvider's, then the browser's.
contextWindownumberThe model's context window in tokens; shows how full it is.
variant'inline' | 'card''inline'inline fits under a message; card is the detailed breakdown.
titleReactNodeCard heading. Defaults to labels.title.
labelsPartial<TokenUsageLabels>Overrides for the built-in English text; keys left out keep their defaults.

Related components

Previous: Voice Input · Next: Context Budget Meter · All AI chat and agents