import { Button, Popover, PopoverPopup, PopoverPortal, PopoverPositioner, PopoverTrigger, } from "@ace/ui"; import type { Usage as Totals } from "@ace/channel/protocol"; const compact = new Intl.NumberFormat("en-US", { notation: "compact", maximumFractionDigits: 1 }); const exact = new Intl.NumberFormat("en-US"); const dollars = new Intl.NumberFormat("en-US", { style: "currency", currency: "USD", minimumFractionDigits: 2, maximumFractionDigits: 4, }); function cost(value: number): string { return value > 0 && value < 0.0001 ? "<$0.0001" : dollars.format(value); } export function Usage({ value }: { value: Totals }) { const rows = [ ["Input", value.input], ["Output", value.output], ["Cache read", value.cacheRead], ["Cache write", value.cacheWrite], ["Total tokens", value.totalTokens], ] as const; return (
All requests in this chat. Cost uses model list prices; your provider's bill may differ.