Skip to content

Open source CapCut alternative.

TypeScript

refactor(site): remove the settings usage page

David Lebcfed122a0a7
diff --git a/site/src/app/[locale]/cut/app/(home)/settings/SettingsHeader.tsx b/site/src/app/[locale]/cut/app/(home)/settings/SettingsHeader.tsx
index 18b9c9e6..b61e1dfc 100644
--- a/site/src/app/[locale]/cut/app/(home)/settings/SettingsHeader.tsx
+++ b/site/src/app/[locale]/cut/app/(home)/settings/SettingsHeader.tsx
@@ -4,35 +4,24 @@ import { usePathname } from "next/navigation";
import { useTranslations } from "next-intl";
import { useTabTitle } from "@/cut/hooks/useTabTitle";
-import { cn } from "@/lib/utils";
-// Ordered so the more specific path wins the suffix match. Billing pins its
-// title while the cards scroll; usage lets the title scroll away so the
-// table's own pinned column header takes the top of the pane.
+// Ordered so the more specific path wins the suffix match. The title stays
+// pinned while the cards scroll.
// Titles and descriptions are `settings.header` catalog keys.
const SECTIONS = [
- {
- suffix: "/settings/usage",
- title: "usageTitle",
- description: "usageDescription",
- pinned: false,
- },
{
suffix: "/settings/profile",
title: "profileTitle",
- pinned: true,
},
{
suffix: "/settings",
title: "billingTitle",
description: "billingDescription",
- pinned: true,
},
] as const satisfies {
suffix: string;
title: string;
description?: string;
- pinned: boolean;
}[];
export function SettingsHeader() {
@@ -45,12 +34,7 @@ export function SettingsHeader() {
const description = "description" in section ? t(section.description) : null;
useTabTitle(title);
return (
- <div
- className={cn(
- "mx-auto w-full max-w-6xl shrink-0 px-10 pt-9 pb-5",
- section.pinned && "sticky top-0 z-20 bg-background",
- )}
- >
+ <div className="sticky top-0 z-20 mx-auto w-full max-w-6xl shrink-0 bg-background px-10 pt-9 pb-5">
<h1 className="text-lg font-semibold tracking-tight">{title}</h1>
{description && (
<p className="mt-1 text-sm text-muted-foreground">{description}</p>
diff --git a/site/src/app/[locale]/cut/app/(home)/settings/usage/page.tsx b/site/src/app/[locale]/cut/app/(home)/settings/usage/page.tsx
deleted file mode 100644
index 22024129..00000000
--- a/site/src/app/[locale]/cut/app/(home)/settings/usage/page.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-"use client";
-
-import { UsageHistoryCard } from "@/components/UsageHistoryCard";
-import { SettingsGuard } from "@/cut/components/SettingsGuard";
-
-export default function CutUsagePage() {
- return (
- <SettingsGuard>
- <UsageHistoryCard />
- </SettingsGuard>
- );
-}
diff --git a/site/src/app/api/billing/usage/route.ts b/site/src/app/api/billing/usage/route.ts
deleted file mode 100644
index 7b105624..00000000
--- a/site/src/app/api/billing/usage/route.ts
+++ /dev/null
@@ -1,69 +0,0 @@
-import { NextResponse } from "next/server";
-
-import { Prisma } from "@/generated/prisma/client";
-
-import { creditMicrosToString } from "@/lib/credits/amounts";
-import { readInferenceUsageBreakdown } from "@/lib/credits/inference";
-import {
- donkeySessionUserId,
- unauthorizedResponse,
- withDonkeyAuth,
-} from "@/lib/donkey-api-auth";
-import { prisma } from "@/lib/prisma";
-
-// Up to 5 pages of 25 in the usage tab.
-const recentLimit = 125;
-
-const recentSelect = {
- billingStatus: true,
- conversationId: true,
- createdAt: true,
- creditCostMicros: true,
- errorCode: true,
- model: true,
- normalizedUsage: true,
- requestKind: true,
- status: true,
-} satisfies Prisma.InferenceUsageEventSelect;
-
-type RecentEvent = Prisma.InferenceUsageEventGetPayload<{
- select: typeof recentSelect;
-}>;
-
-function toRecentCall(event: RecentEvent) {
- return {
- billingStatus: event.billingStatus,
- // The app conversation this call belongs to; null for background work and
- // pre-grouping rows. The usage UI groups rows by this.
- conversationId: event.conversationId,
- // Credits are dollar-denominated (1 credit = $1), so this string is USD.
- costCredits: creditMicrosToString(event.creditCostMicros),
- createdAt: event.createdAt.toISOString(),
- errorCode: event.errorCode,
- model: event.model,
- requestKind: event.requestKind,
- status: event.status,
- // Per-call token breakdown — what actually drove the cost. Large input =
- // long question/context; large output = long answer.
- usage: readInferenceUsageBreakdown(event.normalizedUsage),
- };
-}
-
-// Recent credit-billed inference calls for the settings usage UI.
-export const GET = withDonkeyAuth(async (request) => {
- const userId = donkeySessionUserId(request);
- if (!userId) {
- return unauthorizedResponse();
- }
-
- const recent = await prisma.inferenceUsageEvent.findMany({
- orderBy: { createdAt: "desc" },
- select: recentSelect,
- take: recentLimit,
- where: { billingStatus: { not: "included" }, userId },
- });
-
- return NextResponse.json({
- recent: recent.map(toRecentCall),
- });
-});
diff --git a/site/src/components/UsageHistoryCard.tsx b/site/src/components/UsageHistoryCard.tsx
deleted file mode 100644
index 6e9ad7f5..00000000
--- a/site/src/components/UsageHistoryCard.tsx
+++ /dev/null
@@ -1,434 +0,0 @@
-"use client";
-
-import { useFormatter, useLocale, useTranslations } from "next-intl";
-import { Fragment, useRef, useState, type KeyboardEvent } from "react";
-
-import { useUsage, type UsageHistory } from "@/queries/billing";
-import { Badge } from "@/components/ui/badge";
-import { Skeleton } from "@/components/ui/skeleton";
-import {
- Pagination,
- PaginationContent,
- PaginationItem,
- PaginationLink,
- PaginationNext,
- PaginationPrevious,
-} from "@/components/ui/pagination";
-import {
- Table,
- TableBody,
- TableCell,
- TableHead,
- TableHeader,
- TableRow,
-} from "@/components/ui/table";
-import type { Locale } from "@/i18n/locales";
-import { formatCreditCharge } from "@/lib/credits/format-credits";
-import { cn } from "@/lib/utils";
-
-type RecentCall = UsageHistory["recent"][number];
-
-// What the helpers below need to word a row: the reader's locale and the
-// "Included" label.
-type Wording = { locale: Locale; included: string };
-
-// Stable identity for a call so expansion state survives a background refetch
-// (which can reorder/prepend rows) instead of being pinned to an array index.
-function callKey(call: RecentCall): string {
- return `${call.createdAt}-${call.requestKind}-${call.costCredits}`;
-}
-
-// A charge in credits, rounded up so a sub-credit call reads as 1; a zero or
-// unreadable value reads as 0 credits.
-function formatCostValue(value: number, locale: Locale): string {
- if (!Number.isFinite(value) || value <= 0) {
- return formatCreditCharge(0, locale);
- }
- return formatCreditCharge(value, locale);
-}
-
-function formatCallCost(call: RecentCall, wording: Wording): string {
- if (call.billingStatus === "included") {
- return wording.included;
- }
- return formatCostValue(Number.parseFloat(call.costCredits), wording.locale);
-}
-
-// Conversation ids are long opaque strings; a short prefix is enough to tell
-// groups apart without dominating the row.
-const CONVERSATION_ID_CHARS = 8;
-
-// A conversation block's combined cost for its header. An all-included block has
-// no credit cost, so label it "Included".
-function blockCostSummary(calls: RecentCall[], wording: Wording): string {
- if (calls.every((call) => call.billingStatus === "included")) {
- return wording.included;
- }
- const total = calls.reduce((sum, call) => {
- const value = Number.parseFloat(call.costCredits);
- return Number.isFinite(value) ? sum + value : sum;
- }, 0);
- return formatCostValue(total, wording.locale);
-}
-
-// Share of the block's input tokens the provider served from cache, across all its calls. This is the
-// signal for whether our stable prompt prefix is being reused: a near-0% share over a many-call run means
-// the cache isn't being hit and we're paying full input rate every step. null when the block billed no
-// input tokens (nothing to cache).
-function blockCachedShare(calls: RecentCall[]): number | null {
- let input = 0;
- let cached = 0;
- for (const call of calls) {
- input += call.usage.inputTokens;
- cached += call.usage.cachedInputTokens;
- }
- return input > 0 ? Math.round((cached / input) * 100) : null;
-}
-
-// Per-row annotation for the interleaved timeline. Rows keep the server's
-// chronological (newest-first) order: background (no-conversation) calls are
-// NEVER pulled together — each stays wherever it happened, between the groups. A
-// maximal run of consecutive same-conversation calls is one "block"; every row
-// in it shares a blockKey (the run's start index; -1 for background) plus the
-// run's total count and cost, so a header can render at the run's start and again
-// at a page top when a run carries across the page boundary.
-type RowAnnotation = {
- blockKey: number;
- blockCount: number;
- blockSummary: string;
- blockCachedShare: number | null;
-};
-
-function annotateRows(rows: RecentCall[], wording: Wording): RowAnnotation[] {
- const annotations: RowAnnotation[] = rows.map(() => ({
- blockKey: -1,
- blockCount: 0,
- blockSummary: "",
- blockCachedShare: null,
- }));
- let index = 0;
- while (index < rows.length) {
- const conversationId = rows[index].conversationId;
- if (conversationId === null) {
- index += 1;
- continue;
- }
- let end = index;
- while (end < rows.length && rows[end].conversationId === conversationId) {
- end += 1;
- }
- const block = rows.slice(index, end);
- const summary = blockCostSummary(block, wording);
- const cachedShare = blockCachedShare(block);
- for (let i = index; i < end; i += 1) {
- annotations[i] = {
- blockKey: index,
- blockCount: block.length,
- blockSummary: summary,
- blockCachedShare: cachedShare,
- };
- }
- index = end;
- }
- return annotations;
-}
-
-function formatDuration(millis: number): string {
- return millis >= 1000 ? `${(millis / 1000).toFixed(1)}s` : `${millis}ms`;
-}
-
-// A call's moment, to the second: "10/27/2026, 3:04:05 PM" in English.
-const CALL_DATE_FORMAT = {
- year: "numeric",
- month: "numeric",
- day: "numeric",
- hour: "numeric",
- minute: "2-digit",
- second: "2-digit",
-} as const;
-
-// Page the table client-side, capped so the control never grows past 5 pages.
-const ROWS_PER_PAGE = 25;
-const MAX_PAGES = 5;
-
-function CallDetail({ call }: { call: RecentCall }) {
- const t = useTranslations("settings.usage");
- const format = useFormatter();
- const formatTokens = (value: number) => format.number(value);
- const { usage } = call;
- const imageBilled = usage.generationCount > 0;
- const tokenBilled =
- usage.inputTokens > 0 || usage.outputTokens > 0 || usage.totalTokens > 0;
-
- const stats: { label: string; value: string }[] = [];
- if (imageBilled) {
- stats.push({
- label: t("imagesGenerated"),
- value: formatTokens(usage.generationCount),
- });
- }
- if (tokenBilled) {
- // Cached input is billed at a fraction of the input rate, so the cached SHARE is the signal for
- // whether the provider is reusing our stable prompt prefix. Show it as its own stat (with the share)
- // and always — a 0% cached call is a cache MISS worth seeing, not an absence to hide.
- const cachedShare =
- usage.inputTokens > 0
- ? Math.round((usage.cachedInputTokens / usage.inputTokens) * 100)
- : 0;
- stats.push(
- { label: t("inputTokens"), value: formatTokens(usage.inputTokens) },
- {
- label: t("cachedInput"),
- value: t("cachedValue", { tokens: formatTokens(usage.cachedInputTokens), share: cachedShare }),
- },
- { label: t("outputTokens"), value: formatTokens(usage.outputTokens) },
- { label: t("totalTokens"), value: formatTokens(usage.totalTokens) },
- );
- }
- // Only some (audio-priced) calls report a duration; omit it otherwise.
- if (usage.durationMillis > 0) {
- stats.push({ label: t("duration"), value: formatDuration(usage.durationMillis) });
- }
-
- // Explain what drove the cost in terms of how the call is priced.
- const explanation = imageBilled
- ? t("imageExplanation")
- : tokenBilled
- ? t("tokenExplanation")
- : t("noUsage");
-
- return (
- <div className="space-y-3 px-2 py-1 text-sm">
- <p className="text-muted-foreground">{explanation}</p>
- {stats.length > 0 ? (
- <dl className="grid grid-cols-2 gap-x-8 gap-y-1 sm:grid-cols-4">
- {stats.map((stat) => (
- <div key={stat.label}>
- <dt className="text-xs text-muted-foreground">{stat.label}</dt>
- <dd className="font-medium tabular-nums">{stat.value}</dd>
- </div>
- ))}
- </dl>
- ) : null}
- {call.errorCode ? (
- <p className="text-destructive">{t("error", { code: call.errorCode })}</p>
- ) : null}
- </div>
- );
-}
-
-// The table renders directly on the page and stretches to the space its
-// parent gives it; the surrounding pane owns scrolling.
-export function UsageHistoryCard() {
- const t = useTranslations("settings.usage");
- const locale = useLocale();
- const format = useFormatter();
- const wording: Wording = { locale, included: t("included") };
- const usage = useUsage();
- const [page, setPage] = useState(1);
- // Keyed by call identity (not row index) so a refetch can't leave the open
- // detail pinned to whatever row now sits at that index.
- const [expanded, setExpanded] = useState<string | null>(null);
- // One ref per rendered row so arrow keys can move focus to the sibling row.
- const rowRefs = useRef<(HTMLTableRowElement | null)[]>([]);
-
- if (usage.isLoading) {
- return <Skeleton className="h-64 w-full" />;
- }
-
- const rows = usage.data?.recent ?? [];
- // Annotate in the server's chronological order so conversations group in place
- // and individual (no-conversation) calls stay interleaved between them.
- const annotations = annotateRows(rows, wording);
-
- const totalPages = Math.min(
- MAX_PAGES,
- Math.max(1, Math.ceil(rows.length / ROWS_PER_PAGE)),
- );
- // Clamp in case rows shrank on a refetch below the current page.
- const currentPage = Math.min(page, totalPages);
- const pageStart = (currentPage - 1) * ROWS_PER_PAGE;
- const pageRows = rows.slice(pageStart, pageStart + ROWS_PER_PAGE);
-
- const goToPage = (next: number) => {
- setPage(next);
- setExpanded(null);
- };
-
- const focusRow = (index: number) => {
- const call = pageRows[index];
- if (!call) {
- return;
- }
- setExpanded(callKey(call));
- rowRefs.current[index]?.focus();
- };
-
- const onRowKeyDown = (event: KeyboardEvent<HTMLTableRowElement>, index: number) => {
- if (event.key === "ArrowDown") {
- event.preventDefault();
- focusRow(Math.min(index + 1, pageRows.length - 1));
- } else if (event.key === "ArrowUp") {
- event.preventDefault();
- focusRow(Math.max(index - 1, 0));
- } else if (event.key === "Enter" || event.key === " ") {
- event.preventDefault();
- const key = callKey(pageRows[index]);
- setExpanded(expanded === key ? null : key);
- } else if (event.key === "Escape") {
- setExpanded(null);
- }
- };
-
- return (
- <div className="space-y-4">
- {/* The table's own container must stay overflow-visible so the sticky
- header row pins against the real scroll ancestor, the surrounding
- pane. */}
- <div className="[&_[data-slot=table-container]]:overflow-visible">
- {rows.length === 0 ? (
- <p className="text-sm text-muted-foreground">{t("noCalls")}</p>
- ) : (
- <Table>
- <TableHeader className="sticky top-0 z-10 bg-background">
- <TableRow>
- <TableHead>{t("date")}</TableHead>
- <TableHead>{t("kind")}</TableHead>
- <TableHead>{t("model")}</TableHead>
- <TableHead className="text-right">{t("cost")}</TableHead>
- <TableHead>{t("status")}</TableHead>
- </TableRow>
- </TableHeader>
- <TableBody>
- {pageRows.map((call, index) => {
- const globalIndex = pageStart + index;
- const annotation = annotations[globalIndex];
- const conversationId = call.conversationId;
- const inConversation =
- annotation.blockKey !== -1 && annotation.blockCount > 1;
- const key = callKey(call);
- const isOpen = expanded === key;
- // Header before the first row of each conversation block (and at
- // the page top, since a block can carry over from the prior page).
- // Background rows render flat, in place, with no header.
- const prevAnnotation =
- index === 0 ? null : annotations[globalIndex - 1];
- const startsBlock =
- inConversation &&
- (index === 0 ||
- prevAnnotation?.blockKey !== annotation.blockKey);
- return (
- <Fragment key={`${key}-${globalIndex}`}>
- {startsBlock && conversationId !== null ? (
- <TableRow className="hover:bg-transparent">
- <TableCell
- className="font-bold text-muted-foreground"
- colSpan={5}
- >
- <div className="flex items-center justify-between gap-2">
- <span>{t("conversation", { id: conversationId.slice(0, CONVERSATION_ID_CHARS) })}</span>
- <span className="tabular-nums">
- {t("calls", { count: annotation.blockCount })}
- {" · "}
- {annotation.blockSummary}
- {annotation.blockCachedShare !== null
- ? ` · ${t("cachedShare", { share: annotation.blockCachedShare })}`
- : null}
- </span>
- </div>
- </TableCell>
- </TableRow>
- ) : null}
- <TableRow
- ref={(el) => {
- rowRefs.current[index] = el;
- }}
- aria-expanded={isOpen}
- className="cursor-pointer outline-none focus-visible:bg-muted/50"
- onClick={() => {
- setExpanded(isOpen ? null : key);
- rowRefs.current[index]?.focus();
- }}
- onKeyDown={(event) => onRowKeyDown(event, index)}
- tabIndex={0}
- >
- {/* Indent a conversation's calls so they read as nested
- under their header; background calls stay flush. */}
- <TableCell className={cn(inConversation && "pl-8")}>
- {format.dateTime(new Date(call.createdAt), CALL_DATE_FORMAT)}
- </TableCell>
- <TableCell>{call.requestKind}</TableCell>
- <TableCell>{call.model}</TableCell>
- <TableCell className="text-right tabular-nums">
- {formatCallCost(call, wording)}
- </TableCell>
- <TableCell>
- <Badge
- variant={
- call.status === "succeeded"
- ? "secondary"
- : "destructive"
- }
- >
- {t("callStatus", { status: call.status })}
- </Badge>
- </TableCell>
- </TableRow>
- {isOpen ? (
- <TableRow className="hover:bg-transparent">
- <TableCell className="bg-muted/30" colSpan={5}>
- <CallDetail call={call} />
- </TableCell>
- </TableRow>
- ) : null}
- </Fragment>
- );
- })}
- </TableBody>
- </Table>
- )}
- </div>
-
- {totalPages > 1 ? (
- <div className="sticky bottom-0 z-10 bg-background py-3">
- <Pagination>
- <PaginationContent>
- <PaginationItem>
- <PaginationPrevious
- aria-disabled={currentPage <= 1}
- className={
- currentPage <= 1 ? "pointer-events-none opacity-50" : undefined
- }
- onClick={() => goToPage(Math.max(1, currentPage - 1))}
- />
- </PaginationItem>
- {Array.from({ length: totalPages }, (_, i) => i + 1).map(
- (pageNumber) => (
- <PaginationItem key={pageNumber}>
- <PaginationLink
- isActive={pageNumber === currentPage}
- onClick={() => goToPage(pageNumber)}
- >
- {pageNumber}
- </PaginationLink>
- </PaginationItem>
- ),
- )}
- <PaginationItem>
- <PaginationNext
- aria-disabled={currentPage >= totalPages}
- className={
- currentPage >= totalPages
- ? "pointer-events-none opacity-50"
- : undefined
- }
- onClick={() => goToPage(Math.min(totalPages, currentPage + 1))}
- />
- </PaginationItem>
- </PaginationContent>
- </Pagination>
- </div>
- ) : null}
- </div>
- );
-}
diff --git a/site/src/cut/components/NavUser.tsx b/site/src/cut/components/NavUser.tsx
index 062f7fc9..5fc1db1e 100644
--- a/site/src/cut/components/NavUser.tsx
+++ b/site/src/cut/components/NavUser.tsx
@@ -3,7 +3,6 @@
import { useRouter } from "next/navigation";
import { useTranslations } from "next-intl";
import {
- ChartColumn,
ChevronRight,
CreditCard,
EllipsisVertical,
@@ -120,9 +119,6 @@ export function NavUser() {
<DropdownMenuItem onClick={() => router.push(`${base}/settings`)}>
<CreditCard /> {t("billing")}
</DropdownMenuItem>
- <DropdownMenuItem onClick={() => router.push(`${base}/settings/usage`)}>
- <ChartColumn /> {t("usage")}
- </DropdownMenuItem>
{/* The welcome sequence is a full-window overlay mounted in the app
shell, so this asks for it rather than routing anywhere. */}
<DropdownMenuItem onClick={openOnboarding}>
diff --git a/site/src/cut/components/desktopFolders.tsx b/site/src/cut/components/desktopFolders.tsx
index c07147bf..13079623 100644
--- a/site/src/cut/components/desktopFolders.tsx
+++ b/site/src/cut/components/desktopFolders.tsx
@@ -23,6 +23,9 @@ import { formatBytes } from "@/lib/bytes";
import { RefDropZone } from "./RefDropZone";
import { cn } from "@/lib/utils";
+// A folder under a drag that would land in it, in the selection blue.
+const DROP_OVER = "bg-[#0a84ff]/15 dark:bg-[#0a84ff]/25";
+
// A desktop-style folder surface shared by the projects home and the library:
// macOS folder tiles, marquee multi-select, drag a selection onto a folder with
// a ghost, and open-to-navigate. Both pages carry a selection as a JSON array of
@@ -602,7 +605,11 @@ export function FolderShelf<F extends DeskFolder>({
e.dataTransfer.dropEffect = dragTypes(e).includes("Files") ? "copy" : "move";
setOver(f.id);
},
- onDragLeave: () => setOver((o: string | null) => (o === f.id ? null : o)),
+ onDragLeave: (e: React.DragEvent) => {
+ // Crossing onto the tile's own glyph or label is still over it.
+ if (e.currentTarget.contains(e.relatedTarget as Node | null)) return;
+ setOver((o: string | null) => (o === f.id ? null : o));
+ },
onDrop: (e: React.DragEvent) => {
if (!accepts(e, f.id)) return;
e.preventDefault();
@@ -678,7 +685,7 @@ export function FolderShelf<F extends DeskFolder>({
<div
className={cn(
"group/f flex cursor-pointer items-center gap-2.5 rounded-lg px-2 py-1.5 text-left transition-colors hover:bg-muted/60",
- isOver && "bg-primary/10",
+ isOver && DROP_OVER,
isPicked && PICKED_RING
)}
{...interact}
@@ -704,6 +711,7 @@ export function FolderShelf<F extends DeskFolder>({
<div
className={cn(
"group/f relative flex w-[92px] cursor-pointer flex-col items-start rounded-xl px-2 py-1.5 text-left transition-colors hover:bg-muted/60",
+ isOver && DROP_OVER,
isPicked && PICKED_RING
)}
{...interact}
@@ -729,7 +737,7 @@ export function FolderShelf<F extends DeskFolder>({
<RefDropZone
key={f.id}
onRef={(r) => onRefDrop(r, f.id)}
- activeClassName={cn("bg-primary/10", rows ? "rounded-lg" : "rounded-xl")}
+ activeClassName={cn(DROP_OVER, rows ? "rounded-lg" : "rounded-xl")}
>
{tile}
</RefDropZone>
diff --git a/site/src/i18n/messages/.source-lock.json b/site/src/i18n/messages/.source-lock.json
index 1e29219f..fa10be07 100644
--- a/site/src/i18n/messages/.source-lock.json
+++ b/site/src/i18n/messages/.source-lock.json
@@ -1272,7 +1272,6 @@
"cameraRoll.deleteTitle": "d03fa8907065",
"cameraRoll.deleteBody": "176bfd656d76",
"navUser.billing": "abaec4522bf6",
- "navUser.usage": "0bb18642b70b",
"navUser.onboarding": "c71537942e9f",
"navUser.runLocally": "a3c522448148",
"navUser.logOut": "6e78c91f5a05",
@@ -2788,8 +2787,6 @@
"editor.saveFailed": "a61a856b0a59",
"meta.description": "18e44ce87a6f",
"saveFailed": "a61a856b0a59",
- "header.usageTitle": "0bb18642b70b",
- "header.usageDescription": "fa115bcb811c",
"header.profileTitle": "ff4fc0276e96",
"header.billingTitle": "abaec4522bf6",
"header.billingDescription": "914fef3051a9",
@@ -2865,28 +2862,6 @@
"phoneLink.unpair": "9c293ad46574",
"phoneLink.unpairHint": "86c79d75ea32",
"phoneLink.unreachable": "abe5426309d8",
- "usage.included": "3e2c5704094d",
- "usage.conversation": "9a1d1af561e0",
- "usage.calls": "3dc1b14c78af",
- "usage.cachedShare": "28fe39708096",
- "usage.date": "eb9a4bc1c0c1",
- "usage.kind": "e00ac23f2ac2",
- "usage.model": "68c2cc7f0cea",
- "usage.cost": "64ae43e8fe76",
- "usage.status": "bae7d5be7082",
- "usage.callStatus": "5aca847582b2",
- "usage.noCalls": "f3ac5747be79",
- "usage.imagesGenerated": "3adf1af51bcd",
- "usage.inputTokens": "92f7d22224b1",
- "usage.cachedInput": "36e191c9dfc1",
- "usage.cachedValue": "c2e72dd0d33d",
- "usage.outputTokens": "b879f52df785",
- "usage.totalTokens": "e6dad16eef95",
- "usage.duration": "1370004da76f",
- "usage.imageExplanation": "8c8da0c77510",
- "usage.tokenExplanation": "c221e48ce449",
- "usage.noUsage": "e52080515aa2",
- "usage.error": "1d55c0693835",
"checkout.creditsProduct": "10d6b61cf70d"
},
"de/share": {
@@ -4326,7 +4301,6 @@
"cameraRoll.deleteTitle": "d03fa8907065",
"cameraRoll.deleteBody": "176bfd656d76",
"navUser.billing": "abaec4522bf6",
- "navUser.usage": "0bb18642b70b",
"navUser.onboarding": "c71537942e9f",
"navUser.runLocally": "a3c522448148",
"navUser.logOut": "6e78c91f5a05",
@@ -5842,8 +5816,6 @@
"editor.saveFailed": "a61a856b0a59",
"meta.description": "18e44ce87a6f",
"saveFailed": "a61a856b0a59",
- "header.usageTitle": "0bb18642b70b",
- "header.usageDescription": "fa115bcb811c",
"header.profileTitle": "ff4fc0276e96",
"header.billingTitle": "abaec4522bf6",
"header.billingDescription": "914fef3051a9",
@@ -5919,28 +5891,6 @@
"phoneLink.unpair": "9c293ad46574",
"phoneLink.unpairHint": "86c79d75ea32",
"phoneLink.unreachable": "abe5426309d8",
- "usage.included": "3e2c5704094d",
- "usage.conversation": "9a1d1af561e0",
- "usage.calls": "3dc1b14c78af",
- "usage.cachedShare": "28fe39708096",
- "usage.date": "eb9a4bc1c0c1",
- "usage.kind": "e00ac23f2ac2",
- "usage.model": "68c2cc7f0cea",
- "usage.cost": "64ae43e8fe76",
- "usage.status": "bae7d5be7082",
- "usage.callStatus": "5aca847582b2",
- "usage.noCalls": "f3ac5747be79",
- "usage.imagesGenerated": "3adf1af51bcd",
- "usage.inputTokens": "92f7d22224b1",
- "usage.cachedInput": "36e191c9dfc1",
- "usage.cachedValue": "c2e72dd0d33d",
- "usage.outputTokens": "b879f52df785",
- "usage.totalTokens": "e6dad16eef95",
- "usage.duration": "1370004da76f",
- "usage.imageExplanation": "8c8da0c77510",
- "usage.tokenExplanation": "c221e48ce449",
- "usage.noUsage": "e52080515aa2",
- "usage.error": "1d55c0693835",
"checkout.creditsProduct": "10d6b61cf70d"
},
"es/share": {
@@ -7380,7 +7330,6 @@
"cameraRoll.deleteTitle": "d03fa8907065",
"cameraRoll.deleteBody": "176bfd656d76",
"navUser.billing": "abaec4522bf6",
- "navUser.usage": "0bb18642b70b",
"navUser.onboarding": "c71537942e9f",
"navUser.runLocally": "a3c522448148",
"navUser.logOut": "6e78c91f5a05",
@@ -8896,8 +8845,6 @@
"editor.saveFailed": "a61a856b0a59",
"meta.description": "18e44ce87a6f",
"saveFailed": "a61a856b0a59",
- "header.usageTitle": "0bb18642b70b",
- "header.usageDescription": "fa115bcb811c",
"header.profileTitle": "ff4fc0276e96",
"header.billingTitle": "abaec4522bf6",
"header.billingDescription": "914fef3051a9",
@@ -8973,28 +8920,6 @@
"phoneLink.unpair": "9c293ad46574",
"phoneLink.unpairHint": "86c79d75ea32",
"phoneLink.unreachable": "abe5426309d8",
- "usage.included": "3e2c5704094d",
- "usage.conversation": "9a1d1af561e0",
- "usage.calls": "3dc1b14c78af",
- "usage.cachedShare": "28fe39708096",
- "usage.date": "eb9a4bc1c0c1",
- "usage.kind": "e00ac23f2ac2",
- "usage.model": "68c2cc7f0cea",
- "usage.cost": "64ae43e8fe76",
- "usage.status": "bae7d5be7082",
- "usage.callStatus": "5aca847582b2",
- "usage.noCalls": "f3ac5747be79",
- "usage.imagesGenerated": "3adf1af51bcd",
- "usage.inputTokens": "92f7d22224b1",
- "usage.cachedInput": "36e191c9dfc1",
- "usage.cachedValue": "c2e72dd0d33d",
- "usage.outputTokens": "b879f52df785",
- "usage.totalTokens": "e6dad16eef95",
- "usage.duration": "1370004da76f",
- "usage.imageExplanation": "8c8da0c77510",
- "usage.tokenExplanation": "c221e48ce449",
- "usage.noUsage": "e52080515aa2",
- "usage.error": "1d55c0693835",
"checkout.creditsProduct": "10d6b61cf70d"
},
"fr/share": {
@@ -10434,7 +10359,6 @@
"cameraRoll.deleteTitle": "d03fa8907065",
"cameraRoll.deleteBody": "176bfd656d76",
"navUser.billing": "abaec4522bf6",
- "navUser.usage": "0bb18642b70b",
"navUser.onboarding": "c71537942e9f",
"navUser.runLocally": "a3c522448148",
"navUser.logOut": "6e78c91f5a05",
@@ -11950,8 +11874,6 @@
"editor.saveFailed": "a61a856b0a59",
"meta.description": "18e44ce87a6f",
"saveFailed": "a61a856b0a59",
- "header.usageTitle": "0bb18642b70b",
- "header.usageDescription": "fa115bcb811c",
"header.profileTitle": "ff4fc0276e96",
"header.billingTitle": "abaec4522bf6",
"header.billingDescription": "914fef3051a9",
@@ -12027,28 +11949,6 @@
"phoneLink.unpair": "9c293ad46574",
"phoneLink.unpairHint": "86c79d75ea32",
"phoneLink.unreachable": "abe5426309d8",
- "usage.included": "3e2c5704094d",
- "usage.conversation": "9a1d1af561e0",
- "usage.calls": "3dc1b14c78af",
- "usage.cachedShare": "28fe39708096",
- "usage.date": "eb9a4bc1c0c1",
- "usage.kind": "e00ac23f2ac2",
- "usage.model": "68c2cc7f0cea",
- "usage.cost": "64ae43e8fe76",
- "usage.status": "bae7d5be7082",
- "usage.callStatus": "5aca847582b2",
- "usage.noCalls": "f3ac5747be79",
- "usage.imagesGenerated": "3adf1af51bcd",
- "usage.inputTokens": "92f7d22224b1",
- "usage.cachedInput": "36e191c9dfc1",
- "usage.cachedValue": "c2e72dd0d33d",
- "usage.outputTokens": "b879f52df785",
- "usage.totalTokens": "e6dad16eef95",
- "usage.duration": "1370004da76f",
- "usage.imageExplanation": "8c8da0c77510",
- "usage.tokenExplanation": "c221e48ce449",
- "usage.noUsage": "e52080515aa2",
- "usage.error": "1d55c0693835",
"checkout.creditsProduct": "10d6b61cf70d"
},
"ja/share": {
@@ -13488,7 +13388,6 @@
"cameraRoll.deleteTitle": "d03fa8907065",
"cameraRoll.deleteBody": "176bfd656d76",
"navUser.billing": "abaec4522bf6",
- "navUser.usage": "0bb18642b70b",
"navUser.onboarding": "c71537942e9f",
"navUser.runLocally": "a3c522448148",
"navUser.logOut": "6e78c91f5a05",
@@ -15004,8 +14903,6 @@
"editor.saveFailed": "a61a856b0a59",
"meta.description": "18e44ce87a6f",
"saveFailed": "a61a856b0a59",
- "header.usageTitle": "0bb18642b70b",
- "header.usageDescription": "fa115bcb811c",
"header.profileTitle": "ff4fc0276e96",
"header.billingTitle": "abaec4522bf6",
"header.billingDescription": "914fef3051a9",
@@ -15081,28 +14978,6 @@
"phoneLink.unpair": "9c293ad46574",
"phoneLink.unpairHint": "86c79d75ea32",
"phoneLink.unreachable": "abe5426309d8",
- "usage.included": "3e2c5704094d",
- "usage.conversation": "9a1d1af561e0",
- "usage.calls": "3dc1b14c78af",
- "usage.cachedShare": "28fe39708096",
- "usage.date": "eb9a4bc1c0c1",
- "usage.kind": "e00ac23f2ac2",
- "usage.model": "68c2cc7f0cea",
- "usage.cost": "64ae43e8fe76",
- "usage.status": "bae7d5be7082",
- "usage.callStatus": "5aca847582b2",
- "usage.noCalls": "f3ac5747be79",
- "usage.imagesGenerated": "3adf1af51bcd",
- "usage.inputTokens": "92f7d22224b1",
- "usage.cachedInput": "36e191c9dfc1",
- "usage.cachedValue": "c2e72dd0d33d",
- "usage.outputTokens": "b879f52df785",
- "usage.totalTokens": "e6dad16eef95",
- "usage.duration": "1370004da76f",
- "usage.imageExplanation": "8c8da0c77510",
- "usage.tokenExplanation": "c221e48ce449",
- "usage.noUsage": "e52080515aa2",
- "usage.error": "1d55c0693835",
"checkout.creditsProduct": "10d6b61cf70d"
},
"ko/share": {
@@ -16542,7 +16417,6 @@
"cameraRoll.deleteTitle": "d03fa8907065",
"cameraRoll.deleteBody": "176bfd656d76",
"navUser.billing": "abaec4522bf6",
- "navUser.usage": "0bb18642b70b",
"navUser.onboarding": "c71537942e9f",
"navUser.runLocally": "a3c522448148",
"navUser.logOut": "6e78c91f5a05",
@@ -18058,8 +17932,6 @@
"editor.saveFailed": "a61a856b0a59",
"meta.description": "18e44ce87a6f",
"saveFailed": "a61a856b0a59",
- "header.usageTitle": "0bb18642b70b",
- "header.usageDescription": "fa115bcb811c",
"header.profileTitle": "ff4fc0276e96",
"header.billingTitle": "abaec4522bf6",
"header.billingDescription": "914fef3051a9",
@@ -18135,28 +18007,6 @@
"phoneLink.unpair": "9c293ad46574",
"phoneLink.unpairHint": "86c79d75ea32",
"phoneLink.unreachable": "abe5426309d8",
- "usage.included": "3e2c5704094d",
- "usage.conversation": "9a1d1af561e0",
- "usage.calls": "3dc1b14c78af",
- "usage.cachedShare": "28fe39708096",
- "usage.date": "eb9a4bc1c0c1",
- "usage.kind": "e00ac23f2ac2",
- "usage.model": "68c2cc7f0cea",
- "usage.cost": "64ae43e8fe76",
- "usage.status": "bae7d5be7082",
- "usage.callStatus": "5aca847582b2",
- "usage.noCalls": "f3ac5747be79",
- "usage.imagesGenerated": "3adf1af51bcd",
- "usage.inputTokens": "92f7d22224b1",
- "usage.cachedInput": "36e191c9dfc1",
- "usage.cachedValue": "c2e72dd0d33d",
- "usage.outputTokens": "b879f52df785",
- "usage.totalTokens": "e6dad16eef95",
- "usage.duration": "1370004da76f",
- "usage.imageExplanation": "8c8da0c77510",
- "usage.tokenExplanation": "c221e48ce449",
- "usage.noUsage": "e52080515aa2",
- "usage.error": "1d55c0693835",
"checkout.creditsProduct": "10d6b61cf70d"
},
"pt-BR/share": {
@@ -19596,7 +19446,6 @@
"cameraRoll.deleteTitle": "d03fa8907065",
"cameraRoll.deleteBody": "176bfd656d76",
"navUser.billing": "abaec4522bf6",
- "navUser.usage": "0bb18642b70b",
"navUser.onboarding": "c71537942e9f",
"navUser.runLocally": "a3c522448148",
"navUser.logOut": "6e78c91f5a05",
@@ -21112,8 +20961,6 @@
"editor.saveFailed": "a61a856b0a59",
"meta.description": "18e44ce87a6f",
"saveFailed": "a61a856b0a59",
- "header.usageTitle": "0bb18642b70b",
- "header.usageDescription": "fa115bcb811c",
"header.profileTitle": "ff4fc0276e96",
"header.billingTitle": "abaec4522bf6",
"header.billingDescription": "914fef3051a9",
@@ -21189,28 +21036,6 @@
"phoneLink.unpair": "9c293ad46574",
"phoneLink.unpairHint": "86c79d75ea32",
"phoneLink.unreachable": "abe5426309d8",
- "usage.included": "3e2c5704094d",
- "usage.conversation": "9a1d1af561e0",
- "usage.calls": "3dc1b14c78af",
- "usage.cachedShare": "28fe39708096",
- "usage.date": "eb9a4bc1c0c1",
- "usage.kind": "e00ac23f2ac2",
- "usage.model": "68c2cc7f0cea",
- "usage.cost": "64ae43e8fe76",
- "usage.status": "bae7d5be7082",
- "usage.callStatus": "5aca847582b2",
- "usage.noCalls": "f3ac5747be79",
- "usage.imagesGenerated": "3adf1af51bcd",
- "usage.inputTokens": "92f7d22224b1",
- "usage.cachedInput": "36e191c9dfc1",
- "usage.cachedValue": "c2e72dd0d33d",
- "usage.outputTokens": "b879f52df785",
- "usage.totalTokens": "e6dad16eef95",
- "usage.duration": "1370004da76f",
- "usage.imageExplanation": "8c8da0c77510",
- "usage.tokenExplanation": "c221e48ce449",
- "usage.noUsage": "e52080515aa2",
- "usage.error": "1d55c0693835",
"checkout.creditsProduct": "10d6b61cf70d"
},
"zh-CN/share": {
diff --git a/site/src/i18n/messages/de/home.json b/site/src/i18n/messages/de/home.json
index e7f9ce3c..176c9d12 100644
--- a/site/src/i18n/messages/de/home.json
+++ b/site/src/i18n/messages/de/home.json
@@ -255,7 +255,6 @@
},
"navUser": {
"billing": "Abrechnung",
- "usage": "Nutzung",
"onboarding": "Onboarding ansehen",
"runLocally": "Lokal auf Mac ausführen",
"logOut": "Abmelden"
diff --git a/site/src/i18n/messages/de/settings.json b/site/src/i18n/messages/de/settings.json
index ac681cf9..c2129fa1 100644
--- a/site/src/i18n/messages/de/settings.json
+++ b/site/src/i18n/messages/de/settings.json
@@ -12,8 +12,6 @@
},
"saveFailed": "Änderung konnte nicht gespeichert werden – versuch es noch einmal.",
"header": {
- "usageTitle": "Nutzung",
- "usageDescription": "Deine KI-Generierungsnutzung in diesem Abrechnungszeitraum.",
"profileTitle": "Profil",
"billingTitle": "Abrechnung",
"billingDescription": "Dein Abo und dein Credit-Guthaben."
@@ -108,30 +106,6 @@
"unpairHint": "Dieses Smartphone kann danach keine Medien mehr hierher senden",
"unreachable": "Konnte die App auf diesem Mac nicht erreichen – prüfe, ob sie läuft."
},
- "usage": {
- "included": "Inbegriffen",
- "conversation": "Unterhaltung {id}",
- "calls": "{count, plural, one {# Aufruf} other {# Aufrufe}}",
- "cachedShare": "{share} % im Cache",
- "date": "Datum",
- "kind": "Art",
- "model": "Modell",
- "cost": "Kosten",
- "status": "Status",
- "callStatus": "{status, select, succeeded {erfolgreich} failed {fehlgeschlagen} other {{status}}}",
- "noCalls": "Noch keine Aufrufe.",
- "imagesGenerated": "Generierte Bilder",
- "inputTokens": "Input-Token",
- "cachedInput": "Gecachter Input",
- "cachedValue": "{tokens} ({share} %)",
- "outputTokens": "Output-Token",
- "totalTokens": "Gesamt-Token",
- "duration": "Dauer",
- "imageExplanation": "Bildgenerierung wird pro Bild abgerechnet, nicht nach Token.",
- "tokenExplanation": "Die Kosten hängen von Tokens ab, wobei der Input hier überwiegt. Gecachter Input ist ein unveränderter Prompt-Präfix, den der Anbieter zu einem Bruchteil des Preises wiederverwendet; ein geringer Cache-Anteil bei wiederholten Aufrufen bedeutet, dass der Cache nicht genutzt wird.",
- "noUsage": "Für diesen Aufruf wurde keine abrechenbare Nutzung erfasst.",
- "error": "Fehler: {code}"
- },
"checkout": {
"creditsProduct": "Donkey-Credits"
}
diff --git a/site/src/i18n/messages/en/home.json b/site/src/i18n/messages/en/home.json
index 10ef06e2..221b8c39 100644
--- a/site/src/i18n/messages/en/home.json
+++ b/site/src/i18n/messages/en/home.json
@@ -255,7 +255,6 @@
},
"navUser": {
"billing": "Billing",
- "usage": "Usage",
"onboarding": "View onboarding",
"runLocally": "Run locally on Mac",
"logOut": "Log out"
diff --git a/site/src/i18n/messages/en/settings.json b/site/src/i18n/messages/en/settings.json
index 8fa66d5d..5af1cdb5 100644
--- a/site/src/i18n/messages/en/settings.json
+++ b/site/src/i18n/messages/en/settings.json
@@ -12,8 +12,6 @@
},
"saveFailed": "Couldn't save that change — try again.",
"header": {
- "usageTitle": "Usage",
- "usageDescription": "Your AI generation usage this billing period.",
"profileTitle": "Profile",
"billingTitle": "Billing",
"billingDescription": "Your subscription and credit balance."
@@ -108,30 +106,6 @@
"unpairHint": "This phone stops being able to send here",
"unreachable": "Couldn't reach the app on this Mac — check that it's running."
},
- "usage": {
- "included": "Included",
- "conversation": "Conversation {id}",
- "calls": "{count, plural, one {# call} other {# calls}}",
- "cachedShare": "{share}% cached",
- "date": "Date",
- "kind": "Kind",
- "model": "Model",
- "cost": "Cost",
- "status": "Status",
- "callStatus": "{status, select, succeeded {succeeded} failed {failed} other {{status}}}",
- "noCalls": "No calls yet.",
- "imagesGenerated": "Images generated",
- "inputTokens": "Input tokens",
- "cachedInput": "Cached input",
- "cachedValue": "{tokens} ({share}%)",
- "outputTokens": "Output tokens",
- "totalTokens": "Total tokens",
- "duration": "Duration",
- "imageExplanation": "Image generation is priced per image, not by tokens.",
- "tokenExplanation": "Cost is driven by tokens, and input dominates here. Cached input is an unchanged prompt prefix the provider reuses at a fraction of the rate; a low cached share on a repeated call means the cache isn't being hit.",
- "noUsage": "No billable usage was recorded for this call.",
- "error": "Error: {code}"
- },
"checkout": {
"creditsProduct": "Donkey credits"
}
diff --git a/site/src/i18n/messages/es/home.json b/site/src/i18n/messages/es/home.json
index 329af577..3d7112a0 100644
--- a/site/src/i18n/messages/es/home.json
+++ b/site/src/i18n/messages/es/home.json
@@ -255,7 +255,6 @@
},
"navUser": {
"billing": "Facturación",
- "usage": "Uso",
"onboarding": "Ver guía de inicio",
"runLocally": "Ejecutar localmente en Mac",
"logOut": "Cerrar sesión"
diff --git a/site/src/i18n/messages/es/settings.json b/site/src/i18n/messages/es/settings.json
index e61628f6..2b03621d 100644
--- a/site/src/i18n/messages/es/settings.json
+++ b/site/src/i18n/messages/es/settings.json
@@ -12,8 +12,6 @@
},
"saveFailed": "No se pudo guardar ese cambio; inténtalo de nuevo.",
"header": {
- "usageTitle": "Uso",
- "usageDescription": "Tu uso de generación con IA en este período de facturación.",
"profileTitle": "Perfil",
"billingTitle": "Facturación",
"billingDescription": "Tu suscripción y saldo de créditos."
@@ -108,30 +106,6 @@
"unpairHint": "Este teléfono ya no podrá enviar archivos aquí",
"unreachable": "No se pudo conectar con la app en esta Mac; comprueba que esté abierta."
},
- "usage": {
- "included": "Incluido",
- "conversation": "Conversación {id}",
- "calls": "{count, plural, one {# llamada} other {# llamadas}}",
- "cachedShare": "{share}% en caché",
- "date": "Fecha",
- "kind": "Tipo",
- "model": "Modelo",
- "cost": "Costo",
- "status": "Estado",
- "callStatus": "{status, select, succeeded {exitosa} failed {fallida} other {{status}}}",
- "noCalls": "Aún no hay llamadas.",
- "imagesGenerated": "Imágenes generadas",
- "inputTokens": "Tokens de entrada",
- "cachedInput": "Entrada en caché",
- "cachedValue": "{tokens} ({share}%)",
- "outputTokens": "Tokens de salida",
- "totalTokens": "Tokens totales",
- "duration": "Duración",
- "imageExplanation": "La generación de imágenes se cobra por imagen, no por tokens.",
- "tokenExplanation": "El costo depende de los tokens, y aquí predomina la entrada. La entrada en caché es un prefijo de prompt sin cambios que el proveedor reutiliza a una fracción de la tarifa; un porcentaje bajo en caché en una llamada repetida significa que no se está aprovechando la caché.",
- "noUsage": "No se registró uso facturable en esta llamada.",
- "error": "Error: {code}"
- },
"checkout": {
"creditsProduct": "Créditos Donkey"
}
diff --git a/site/src/i18n/messages/fr/home.json b/site/src/i18n/messages/fr/home.json
index 47856016..26f13054 100644
--- a/site/src/i18n/messages/fr/home.json
+++ b/site/src/i18n/messages/fr/home.json
@@ -255,7 +255,6 @@
},
"navUser": {
"billing": "Facturation",
- "usage": "Utilisation",
"onboarding": "Voir la prise en main",
"runLocally": "Exécuter localement sur Mac",
"logOut": "Se déconnecter"
diff --git a/site/src/i18n/messages/fr/settings.json b/site/src/i18n/messages/fr/settings.json
index caba8f28..33123337 100644
--- a/site/src/i18n/messages/fr/settings.json
+++ b/site/src/i18n/messages/fr/settings.json
@@ -12,8 +12,6 @@
},
"saveFailed": "Impossible d'enregistrer cette modification — réessayez.",
"header": {
- "usageTitle": "Consommation",
- "usageDescription": "Votre consommation de génération par IA sur cette période de facturation.",
"profileTitle": "Profil",
"billingTitle": "Facturation",
"billingDescription": "Votre abonnement et votre solde de crédits."
@@ -108,30 +106,6 @@
"unpairHint": "Ce téléphone ne pourra plus envoyer de fichiers ici",
"unreachable": "Impossible de joindre l'application sur ce Mac — vérifiez qu'elle est bien lancée."
},
- "usage": {
- "included": "Inclus",
- "conversation": "Conversation {id}",
- "calls": "{count, plural, one {# appel} other {# appels}}",
- "cachedShare": "{share} % en cache",
- "date": "Date",
- "kind": "Type",
- "model": "Modèle",
- "cost": "Coût",
- "status": "Statut",
- "callStatus": "{status, select, succeeded {réussi} failed {échoué} other {{status}}}",
- "noCalls": "Aucun appel pour le moment.",
- "imagesGenerated": "Images générées",
- "inputTokens": "Jetons d'entrée",
- "cachedInput": "Entrée en cache",
- "cachedValue": "{tokens} ({share} %)",
- "outputTokens": "Jetons de sortie",
- "totalTokens": "Total des jetons",
- "duration": "Durée",
- "imageExplanation": "La génération d'images est facturée par image, et non par jeton.",
- "tokenExplanation": "Le coût dépend des jetons, et l'entrée domine ici. L'entrée en cache correspond à un préfixe de prompt inchangé que le fournisseur réutilise à une fraction du tarif ; une faible part en cache lors d'un appel répété indique que le cache n'est pas sollicité.",
- "noUsage": "Aucune utilisation facturable enregistrée pour cet appel.",
- "error": "Erreur : {code}"
- },
"checkout": {
"creditsProduct": "Crédits Donkey"
}
diff --git a/site/src/i18n/messages/ja/home.json b/site/src/i18n/messages/ja/home.json
index 08bd7710..4fb2e6f2 100644
--- a/site/src/i18n/messages/ja/home.json
+++ b/site/src/i18n/messages/ja/home.json
@@ -255,7 +255,6 @@
},
"navUser": {
"billing": "請求とお支払い",
- "usage": "利用状況",
"onboarding": "オンボーディングを見る",
"runLocally": "Macでローカル実行",
"logOut": "ログアウト"
diff --git a/site/src/i18n/messages/ja/settings.json b/site/src/i18n/messages/ja/settings.json
index a10363db..da7dabff 100644
--- a/site/src/i18n/messages/ja/settings.json
+++ b/site/src/i18n/messages/ja/settings.json
@@ -12,8 +12,6 @@
},
"saveFailed": "変更を保存できませんでした。もう一度お試しください。",
"header": {
- "usageTitle": "使用状況",
- "usageDescription": "今請求期間のAI生成使用量です。",
"profileTitle": "プロフィール",
"billingTitle": "お支払い",
"billingDescription": "サブスクリプションとクレジット残高。"
@@ -108,30 +106,6 @@
"unpairHint": "このスマートフォンから送信できなくなります",
"unreachable": "このMac上のアプリに接続できませんでした。実行されているか確認してください。"
},
- "usage": {
- "included": "付属",
- "conversation": "会話 {id}",
- "calls": "{count, plural, other {#回の呼び出し}}",
- "cachedShare": "{share}% キャッシュ済み",
- "date": "日時",
- "kind": "種類",
- "model": "モデル",
- "cost": "コスト",
- "status": "ステータス",
- "callStatus": "{status, select, succeeded {成功} failed {失敗} other {{status}}}",
- "noCalls": "呼び出し履歴はまだありません。",
- "imagesGenerated": "生成された画像",
- "inputTokens": "入力トークン",
- "cachedInput": "キャッシュされた入力",
- "cachedValue": "{tokens} ({share}%)",
- "outputTokens": "出力トークン",
- "totalTokens": "合計トークン",
- "duration": "所要時間",
- "imageExplanation": "画像生成はトークン単位ではなく、画像1枚ごとに課金されます。",
- "tokenExplanation": "コストはトークン数によって決まり、ここでは入力が大半を占めます。キャッシュされた入力とは、プロバイダーが割安な料金で再利用する変更のないプロンプトのプレフィックスです。繰り返しの呼び出しでキャッシュの割合が低い場合は、キャッシュがヒットしていません。",
- "noUsage": "この呼び出しに対する課金対象の利用はありませんでした。",
- "error": "エラー: {code}"
- },
"checkout": {
"creditsProduct": "Donkeyクレジット"
}
diff --git a/site/src/i18n/messages/ko/home.json b/site/src/i18n/messages/ko/home.json
index eeae8481..b0ef8b15 100644
--- a/site/src/i18n/messages/ko/home.json
+++ b/site/src/i18n/messages/ko/home.json
@@ -255,7 +255,6 @@
},
"navUser": {
"billing": "결제",
- "usage": "사용량",
"onboarding": "온보딩 보기",
"runLocally": "Mac에서 로컬로 실행",
"logOut": "로그아웃"
diff --git a/site/src/i18n/messages/ko/settings.json b/site/src/i18n/messages/ko/settings.json
index eab03fdf..16a272e5 100644
--- a/site/src/i18n/messages/ko/settings.json
+++ b/site/src/i18n/messages/ko/settings.json
@@ -12,8 +12,6 @@
},
"saveFailed": "변경 사항을 저장하지 못했어요. 다시 시도해 주세요.",
"header": {
- "usageTitle": "사용량",
- "usageDescription": "이번 결제 주기의 AI 생성 사용량이에요.",
"profileTitle": "프로필",
"billingTitle": "결제",
"billingDescription": "구독 및 크레딧 잔액이에요."
@@ -108,30 +106,6 @@
"unpairHint": "이 휴대폰에서 더 이상 전송할 수 없게 돼요",
"unreachable": "이 Mac의 앱과 연결할 수 없어요. 앱이 실행 중인지 확인해 주세요."
},
- "usage": {
- "included": "기본 제공",
- "conversation": "대화 {id}",
- "calls": "{count, plural, other {호출 #회}}",
- "cachedShare": "{share}% 캐시됨",
- "date": "날짜",
- "kind": "종류",
- "model": "모델",
- "cost": "비용",
- "status": "상태",
- "callStatus": "{status, select, succeeded {성공} failed {실패} other {{status}}}",
- "noCalls": "아직 호출 기록이 없어요.",
- "imagesGenerated": "생성된 이미지",
- "inputTokens": "입력 토큰",
- "cachedInput": "캐시된 입력",
- "cachedValue": "{tokens} ({share}%)",
- "outputTokens": "출력 토큰",
- "totalTokens": "총 토큰",
- "duration": "소요 시간",
- "imageExplanation": "이미지 생성 요금은 토큰이 아닌 이미지 수 기준으로 부과돼요.",
- "tokenExplanation": "비용은 토큰에 따라 책정되며, 여기서는 입력이 대부분을 차지해요. 캐시된 입력은 제공자가 훨씬 저렴한 요금으로 재사용하는 변경되지 않은 프롬프트 접두사예요. 반복 호출 시 캐시 비율이 낮다면 캐시가 적중되지 않고 있다는 뜻이에요.",
- "noUsage": "이 호출에 기록된 청구 가능 사용량이 없어요.",
- "error": "오류: {code}"
- },
"checkout": {
"creditsProduct": "Donkey 크레딧"
}
diff --git a/site/src/i18n/messages/pt-BR/home.json b/site/src/i18n/messages/pt-BR/home.json
index 27341324..d643c915 100644
--- a/site/src/i18n/messages/pt-BR/home.json
+++ b/site/src/i18n/messages/pt-BR/home.json
@@ -255,7 +255,6 @@
},
"navUser": {
"billing": "Faturamento",
- "usage": "Uso",
"onboarding": "Ver introdução",
"runLocally": "Executar localmente no Mac",
"logOut": "Sair"
diff --git a/site/src/i18n/messages/pt-BR/settings.json b/site/src/i18n/messages/pt-BR/settings.json
index 1ed1da6b..0744bfad 100644
--- a/site/src/i18n/messages/pt-BR/settings.json
+++ b/site/src/i18n/messages/pt-BR/settings.json
@@ -12,8 +12,6 @@
},
"saveFailed": "Não foi possível salvar a alteração — tente novamente.",
"header": {
- "usageTitle": "Uso",
- "usageDescription": "Seu uso de geração com IA neste período de faturamento.",
"profileTitle": "Perfil",
"billingTitle": "Faturamento",
"billingDescription": "Sua assinatura e saldo de créditos."
@@ -108,30 +106,6 @@
"unpairHint": "Este celular não poderá mais enviar arquivos para cá",
"unreachable": "Não foi possível conectar ao app neste Mac — verifique se ele está aberto."
},
- "usage": {
- "included": "Incluído",
- "conversation": "Conversa {id}",
- "calls": "{count, plural, one {# chamada} other {# chamadas}}",
- "cachedShare": "{share}% em cache",
- "date": "Data",
- "kind": "Tipo",
- "model": "Modelo",
- "cost": "Custo",
- "status": "Status",
- "callStatus": "{status, select, succeeded {sucesso} failed {falhou} other {{status}}}",
- "noCalls": "Nenhuma chamada ainda.",
- "imagesGenerated": "Imagens geradas",
- "inputTokens": "Tokens de entrada",
- "cachedInput": "Entrada em cache",
- "cachedValue": "{tokens} ({share}%)",
- "outputTokens": "Tokens de saída",
- "totalTokens": "Total de tokens",
- "duration": "Duração",
- "imageExplanation": "A geração de imagens é cobrada por imagem, não por tokens.",
- "tokenExplanation": "O custo é determinado pelos tokens, e a entrada predomina aqui. A entrada em cache é um prefixo de prompt inalterado que o provedor reutiliza por uma fração do valor; uma baixa porcentagem em cache em chamadas repetidas significa que o cache não está sendo aproveitado.",
- "noUsage": "Nenhum consumo faturável foi registrado para esta chamada.",
- "error": "Erro: {code}"
- },
"checkout": {
"creditsProduct": "Créditos Donkey"
}
diff --git a/site/src/i18n/messages/zh-CN/home.json b/site/src/i18n/messages/zh-CN/home.json
index 839d469c..1eb1f2f1 100644
--- a/site/src/i18n/messages/zh-CN/home.json
+++ b/site/src/i18n/messages/zh-CN/home.json
@@ -255,7 +255,6 @@
},
"navUser": {
"billing": "账单",
- "usage": "用量",
"onboarding": "查看新手引导",
"runLocally": "在 Mac 上本地运行",
"logOut": "退出登录"
diff --git a/site/src/i18n/messages/zh-CN/settings.json b/site/src/i18n/messages/zh-CN/settings.json
index dbfbbfd5..1ee50b6a 100644
--- a/site/src/i18n/messages/zh-CN/settings.json
+++ b/site/src/i18n/messages/zh-CN/settings.json
@@ -12,8 +12,6 @@
},
"saveFailed": "无法保存更改,请重试。",
"header": {
- "usageTitle": "用量",
- "usageDescription": "你在此账单周期的 AI 生成用量。",
"profileTitle": "个人资料",
"billingTitle": "账单",
"billingDescription": "你的订阅和点数余额。"
@@ -108,30 +106,6 @@
"unpairHint": "此手机将无法再发送内容至此处",
"unreachable": "无法连接此 Mac 上的应用——请确认其正在运行。"
},
- "usage": {
- "included": "已包含",
- "conversation": "对话 {id}",
- "calls": "{count, plural, other {# 次调用}}",
- "cachedShare": "{share}% 已缓存",
- "date": "日期",
- "kind": "类别",
- "model": "模型",
- "cost": "费用",
- "status": "状态",
- "callStatus": "{status, select, succeeded {成功} failed {失败} other {{status}}}",
- "noCalls": "暂无调用。",
- "imagesGenerated": "生成图片数",
- "inputTokens": "输入 Token",
- "cachedInput": "缓存输入",
- "cachedValue": "{tokens}({share}%)",
- "outputTokens": "输出 Token",
- "totalTokens": "总 Token",
- "duration": "时长",
- "imageExplanation": "图片生成按张计费,不按 Token 计费。",
- "tokenExplanation": "费用取决于 Token,且主要来自输入。缓存输入是指服务商以更低费率复用的未变更提示词前缀;若重复调用时缓存占比较低,则说明未命中缓存。",
- "noUsage": "本次调用未产生计费使用量。",
- "error": "错误:{code}"
- },
"checkout": {
"creditsProduct": "Donkey 积分"
}
diff --git a/site/src/lib/credits/inference.ts b/site/src/lib/credits/inference.ts
index 05533e85..99267e3e 100644
--- a/site/src/lib/credits/inference.ts
+++ b/site/src/lib/credits/inference.ts
@@ -1356,48 +1356,6 @@ function normalizedUsageJson(usage: NormalizedUsage): JsonObject {
};
}
-// The token/usage numbers the usage UI surfaces to explain a call's cost. Read
-// here, right next to normalizedUsageJson which writes them, so the field names
-// stay in sync — renaming a field updates both in one place.
-export type InferenceUsageBreakdown = {
- inputTokens: number;
- cachedInputTokens: number;
- outputTokens: number;
- totalTokens: number;
- generationCount: number;
- durationMillis: number;
-};
-
-export function readInferenceUsageBreakdown(
- normalizedUsage: unknown,
-): InferenceUsageBreakdown {
- const source =
- normalizedUsage &&
- typeof normalizedUsage === "object" &&
- !Array.isArray(normalizedUsage)
- ? (normalizedUsage as Record<string, unknown>)
- : {};
- // Values are written as stringified BigInts (see normalizedUsageJson).
- const num = (key: keyof InferenceUsageBreakdown): number => {
- const value = source[key];
- const parsed =
- typeof value === "string"
- ? Number(value)
- : typeof value === "number"
- ? value
- : 0;
- return Number.isFinite(parsed) ? parsed : 0;
- };
- return {
- cachedInputTokens: num("cachedInputTokens"),
- durationMillis: num("durationMillis"),
- generationCount: num("generationCount"),
- inputTokens: num("inputTokens"),
- outputTokens: num("outputTokens"),
- totalTokens: num("totalTokens"),
- };
-}
-
function nestedJsonValue(
value: JsonObject,
objectKey: string,
diff --git a/site/src/queries/billing.ts b/site/src/queries/billing.ts
index dbe7fe48..065ddf98 100644
--- a/site/src/queries/billing.ts
+++ b/site/src/queries/billing.ts
@@ -4,7 +4,6 @@ import { useMutation, useQuery } from "@tanstack/react-query";
import { apiFetch } from "@/queries/apiClient";
-export const usageQueryKey = ["billing", "usage"] as const;
export const proSubscriptionQueryKey = ["billing", "pro"] as const;
export const introOfferQueryKey = ["billing", "intro-offer"] as const;
@@ -51,40 +50,6 @@ export function useIntroOffer({ enabled = true }: { enabled?: boolean } = {}) {
});
}
-export type UsageHistory = {
- // Recent credit-billed inference calls, newest first.
- recent: {
- createdAt: string;
- // The app conversation this call belongs to; null for background/warm calls
- // and rows recorded before grouping existed. Drives the grouped rendering.
- conversationId: string | null;
- requestKind: string;
- model: string;
- status: string;
- // USD cost charged to credits.
- costCredits: string;
- billingStatus: string;
- errorCode: string | null;
- // Token breakdown that explains the cost.
- usage: {
- inputTokens: number;
- cachedInputTokens: number;
- outputTokens: number;
- totalTokens: number;
- // Images produced by asset_generation calls (priced per image).
- generationCount: number;
- durationMillis: number;
- };
- }[];
-};
-
-export function useUsage() {
- return useQuery({
- queryFn: () => apiFetch<UsageHistory>("/api/billing/usage"),
- queryKey: usageQueryKey,
- });
-}
-
// Mutations return the Stripe URL; the caller redirects the browser. We don't
// invalidate here because the user leaves the page for Stripe.
// A checkout opened from an offer's claim link passes the offer's token, so