Events: AI use in tokens, not rand (for 2.3.0); contracts: token fields on the AI status

Site settings → AI, the usage tables and the 80% email show input/output
tokens and the percentage; the rand amounts from the Hub are dropped on
arrival. AiCall stores each call's tokens (migration ai_tokens). v2
/ai/status and /ai/usage carry tokens instead of cents. Needs Hub 2.0.1
for the token figures; older Hubs show the percentage only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-17 10:59:36 +02:00
co-authored by Claude Opus 5.5
parent e8853cf0c8
commit 38ebce24ab
17 changed files with 725 additions and 169 deletions
@@ -4,7 +4,7 @@ import React, { useEffect, useState } from "react";
import { Sparkles } from "lucide-react";
import { useAuth } from "@/hooks/useAuth";
import { apiV2, type V2Result } from "@/lib/apiV2";
import { loadAiStatus, renewsText } from "@/lib/ai";
import { loadAiStatus, renewsText, tokenText } from "@/lib/ai";
import { errorMessage } from "@/lib/utils";
type Usage = V2Result<"/ai/usage", "get">["data"];
@@ -18,8 +18,8 @@ const HELPERS: { key: Helper; label: string; where: string }[] = [
{ key: "improve_text", label: "Improve this text", where: "Event descriptions, the banner, message boxes" },
];
// Fractions of a cent add up: show R0.0123 below a rand.
const money = (cents: number) => (cents > 0 && cents < 100 ? `R${(cents / 100).toFixed(4)}` : `R${(cents / 100).toFixed(2)}`);
/** "12K in · 3K out" for a row of use. */
const inOut = (u: { inputTokens: number; outputTokens: number }) => `${tokenText(u.inputTokens)} in · ${tokenText(u.outputTokens)} out`;
/** Site settings → AI: the monthly allowance, who used it for what, and a switch per helper. */
export function AiTab({ active }: { active: boolean }) {
@@ -53,7 +53,10 @@ export function AiTab({ active }: { active: boolean }) {
if (!usage) return msg ? <p className="text-sm text-red-700">{msg.text}</p> : <p className="text-sm text-gray-500">Loading…</p>;
const s = usage.status;
const maxDay = Math.max(0.0001, ...usage.days.map(d => d.chargedCents));
const dayTokens = (d: { inputTokens: number; outputTokens: number }) => d.inputTokens + d.outputTokens;
const maxDay = Math.max(1, ...usage.days.map(dayTokens));
const hasTokens = s.usedInputTokens != null && s.usedOutputTokens != null;
const hasCap = s.capInputTokens != null && s.capOutputTokens != null && s.capInputTokens > 0;
return (
<div className="space-y-6">
@@ -72,14 +75,23 @@ export function AiTab({ active }: { active: boolean }) {
<div className="rounded-lg border p-4">
<div className="flex flex-wrap items-baseline justify-between gap-2">
<span className="text-sm font-medium">This month</span>
<span className="text-sm text-gray-600">{money(s.usedCents)} of {money(s.capCents)} · renews on {renewsText(s.renewsOn)}</span>
<span className="text-sm text-gray-600">{s.usedPercent}% used · renews on {renewsText(s.renewsOn)}</span>
</div>
{hasTokens && (
<p className="mt-1 text-sm text-gray-700">
{tokenText(s.usedInputTokens!)} input and {tokenText(s.usedOutputTokens!)} output tokens used
{hasCap && <> of about {tokenText(s.capInputTokens!)} input and {tokenText(s.capOutputTokens!)} output</>}
</p>
)}
<div className="mt-2 h-2 w-full overflow-hidden rounded-full bg-gray-100" role="progressbar" aria-label="AI allowance used" aria-valuenow={s.usedPercent} aria-valuemin={0} aria-valuemax={100}>
<div className={`h-full ${s.usedPercent >= 80 ? "bg-amber-500" : "bg-violet-500"}`} style={{ width: `${s.usedPercent}%` }} />
</div>
{s.capReached && <p className="mt-2 text-sm text-amber-800">The allowance is used up: the AI buttons are disabled until {renewsText(s.renewsOn)}, or until your provider raises it.</p>}
{!s.available && <p className="mt-2 text-sm text-amber-800">The provider&apos;s Hub can&apos;t be reached right now, so AI is unavailable. Everything else works as usual.</p>}
<p className="mt-2 text-xs text-gray-500">Admins get an email when 80% is used.</p>
<p className="mt-2 text-xs text-gray-500">
Admins get an email when 80% is used.
{hasCap && " The allowance in tokens is an estimate: it's what you'd get if half went on input (what's sent) and half on output (the answers). Repeated instructions are cached and cost less, so most sites get more input than this."}
</p>
</div>
)}
@@ -114,8 +126,8 @@ export function AiTab({ active }: { active: boolean }) {
<h3 className="mb-2 font-medium">By person this month</h3>
{usage.people.length === 0 ? <p className="text-sm text-gray-500">Nobody has used AI yet this month.</p> : (
<table className="w-full text-sm">
<thead><tr className="text-left text-xs text-gray-500"><th className="py-1">Person</th><th>Uses</th><th className="text-right">Cost</th></tr></thead>
<tbody>{usage.people.map(p => <tr key={p.userId || "removed"} className="border-t"><td className="py-1">{p.name}</td><td>{p.uses}</td><td className="text-right">{money(p.chargedCents)}</td></tr>)}</tbody>
<thead><tr className="text-left text-xs text-gray-500"><th className="py-1">Person</th><th>Uses</th><th className="text-right">Tokens</th></tr></thead>
<tbody>{usage.people.map(p => <tr key={p.userId || "removed"} className="border-t"><td className="py-1">{p.name}</td><td>{p.uses}</td><td className="text-right">{inOut(p)}</td></tr>)}</tbody>
</table>
)}
</div>
@@ -123,16 +135,16 @@ export function AiTab({ active }: { active: boolean }) {
<h3 className="mb-2 font-medium">By helper this month</h3>
{usage.helpers.length === 0 ? <p className="text-sm text-gray-500">—</p> : (
<table className="w-full text-sm">
<thead><tr className="text-left text-xs text-gray-500"><th className="py-1">Helper</th><th>Uses</th><th className="text-right">Cost</th></tr></thead>
<tbody>{usage.helpers.map(h => <tr key={h.helper} className="border-t"><td className="py-1">{HELPERS.find(x => x.key === h.helper)?.label || h.helper}</td><td>{h.uses}</td><td className="text-right">{money(h.chargedCents)}</td></tr>)}</tbody>
<thead><tr className="text-left text-xs text-gray-500"><th className="py-1">Helper</th><th>Uses</th><th className="text-right">Tokens</th></tr></thead>
<tbody>{usage.helpers.map(h => <tr key={h.helper} className="border-t"><td className="py-1">{HELPERS.find(x => x.key === h.helper)?.label || h.helper}</td><td>{h.uses}</td><td className="text-right">{inOut(h)}</td></tr>)}</tbody>
</table>
)}
</div>
{usage.days.length > 0 && (
<div className="md:col-span-2">
<h3 className="mb-2 font-medium">Per day</h3>
<div className="flex h-20 items-end gap-1" aria-label="AI cost per day this month">
{usage.days.map(d => <div key={d.day} title={`${d.day}: ${d.uses} uses, ${money(d.chargedCents)}`} className="flex-1 rounded-t bg-violet-300" style={{ height: `${Math.max(4, (d.chargedCents / maxDay) * 100)}%` }} />)}
<div className="flex h-20 items-end gap-1" aria-label="AI tokens per day this month">
{usage.days.map(d => <div key={d.day} title={`${d.day}: ${d.uses} uses, ${inOut(d)} tokens`} className="flex-1 rounded-t bg-violet-300" style={{ height: `${Math.max(4, (dayTokens(d) / maxDay) * 100)}%` }} />)}
</div>
</div>
)}
+10 -2
View File
@@ -3,7 +3,7 @@ import type { V2Result } from "@/lib/apiV2";
/**
* AI helpers (2.0). The site calls AI through the Cross Events Hub, which keeps a monthly
* allowance in rand per licence. One status per page load is shared by every AI button
* allowance per licence, shown here as tokens and a percentage (2.3.0). One status per page load is shared by every AI button
* (`useAiStatus`), and every helper call refreshes it — so the buttons disable straight after the
* call that used up the allowance.
*/
@@ -12,7 +12,8 @@ export type AiStatus = V2Result<"/ai/status", "get">["data"];
export type AiHelper = keyof AiStatus["helpers"];
const OFF: AiStatus = {
enabled: false, capReached: false, available: true, capCents: 0, usedCents: 0, usedPercent: 0, renewsOn: null,
enabled: false, capReached: false, available: true, usedPercent: 0, renewsOn: null,
usedInputTokens: null, usedOutputTokens: null, capInputTokens: null, capOutputTokens: null,
helpers: { draft_event: false, summarise_report: false, draft_message: false, summarise_feedback: false, improve_text: false },
};
@@ -46,6 +47,13 @@ export function currentAiStatus(): AiStatus | null {
return current;
}
/** "800", "45K", "1.2M": token counts for people (the allowance is shown in tokens, never rand). */
export function tokenText(n: number): string {
if (n >= 1e6) return `${(n / 1e6).toFixed(n >= 1e7 ? 0 : 1).replace(/\.0$/, "")}M`;
if (n >= 1e3) return `${Math.round(n / 1e3)}K`;
return String(n);
}
/** "1 December" from "2026-12-01". */
export function renewsText(renewsOn: string | null): string {
if (!renewsOn) return "next month";
+439 -86
View File
@@ -67449,16 +67449,61 @@
"type": "boolean",
"description": "false: the Hub couldn't be reached just now"
},
"capCents": {
"type": "number",
"description": "The monthly allowance, in cents"
},
"usedCents": {
"type": "number",
"description": "Used this month, in cents (fractions of a cent)"
},
"usedPercent": {
"type": "number"
"type": "number",
"description": "How much of this month's allowance is used (0–100)"
},
"usedInputTokens": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
],
"description": "Input tokens used this month by all the church's products (null from a Hub before 2.0.1)"
},
"usedOutputTokens": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
],
"description": "Output tokens used this month"
},
"capInputTokens": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
],
"description": "About how many input tokens the monthly allowance holds, if half of it went on input (an estimate: cached prompts cost less)"
},
"capOutputTokens": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
],
"description": "About how many output tokens the allowance holds, if half of it went on output"
},
"renewsOn": {
"description": "YYYY-MM-DD",
@@ -67501,9 +67546,11 @@
"enabled",
"capReached",
"available",
"capCents",
"usedCents",
"usedPercent",
"usedInputTokens",
"usedOutputTokens",
"capInputTokens",
"capOutputTokens",
"renewsOn",
"helpers"
],
@@ -67581,16 +67628,61 @@
"type": "boolean",
"description": "false: the Hub couldn't be reached just now"
},
"capCents": {
"type": "number",
"description": "The monthly allowance, in cents"
},
"usedCents": {
"type": "number",
"description": "Used this month, in cents (fractions of a cent)"
},
"usedPercent": {
"type": "number"
"type": "number",
"description": "How much of this month's allowance is used (0–100)"
},
"usedInputTokens": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
],
"description": "Input tokens used this month by all the church's products (null from a Hub before 2.0.1)"
},
"usedOutputTokens": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
],
"description": "Output tokens used this month"
},
"capInputTokens": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
],
"description": "About how many input tokens the monthly allowance holds, if half of it went on input (an estimate: cached prompts cost less)"
},
"capOutputTokens": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
],
"description": "About how many output tokens the allowance holds, if half of it went on output"
},
"renewsOn": {
"description": "YYYY-MM-DD",
@@ -67633,9 +67725,11 @@
"enabled",
"capReached",
"available",
"capCents",
"usedCents",
"usedPercent",
"usedInputTokens",
"usedOutputTokens",
"capInputTokens",
"capOutputTokens",
"renewsOn",
"helpers"
],
@@ -67695,8 +67789,15 @@
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"chargedCents": {
"type": "number"
"inputTokens": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"outputTokens": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"userId": {
"type": [
@@ -67710,7 +67811,8 @@
},
"required": [
"uses",
"chargedCents",
"inputTokens",
"outputTokens",
"userId",
"name"
],
@@ -67727,8 +67829,15 @@
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"chargedCents": {
"type": "number"
"inputTokens": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"outputTokens": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"helper": {
"type": "string"
@@ -67736,7 +67845,8 @@
},
"required": [
"uses",
"chargedCents",
"inputTokens",
"outputTokens",
"helper"
],
"additionalProperties": false
@@ -67752,8 +67862,15 @@
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"chargedCents": {
"type": "number"
"inputTokens": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"outputTokens": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"day": {
"type": "string"
@@ -67761,7 +67878,8 @@
},
"required": [
"uses",
"chargedCents",
"inputTokens",
"outputTokens",
"day"
],
"additionalProperties": false
@@ -68184,16 +68302,61 @@
"type": "boolean",
"description": "false: the Hub couldn't be reached just now"
},
"capCents": {
"type": "number",
"description": "The monthly allowance, in cents"
},
"usedCents": {
"type": "number",
"description": "Used this month, in cents (fractions of a cent)"
},
"usedPercent": {
"type": "number"
"type": "number",
"description": "How much of this month's allowance is used (0–100)"
},
"usedInputTokens": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
],
"description": "Input tokens used this month by all the church's products (null from a Hub before 2.0.1)"
},
"usedOutputTokens": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
],
"description": "Output tokens used this month"
},
"capInputTokens": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
],
"description": "About how many input tokens the monthly allowance holds, if half of it went on input (an estimate: cached prompts cost less)"
},
"capOutputTokens": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
],
"description": "About how many output tokens the allowance holds, if half of it went on output"
},
"renewsOn": {
"description": "YYYY-MM-DD",
@@ -68236,9 +68399,11 @@
"enabled",
"capReached",
"available",
"capCents",
"usedCents",
"usedPercent",
"usedInputTokens",
"usedOutputTokens",
"capInputTokens",
"capOutputTokens",
"renewsOn",
"helpers"
],
@@ -68479,16 +68644,61 @@
"type": "boolean",
"description": "false: the Hub couldn't be reached just now"
},
"capCents": {
"type": "number",
"description": "The monthly allowance, in cents"
},
"usedCents": {
"type": "number",
"description": "Used this month, in cents (fractions of a cent)"
},
"usedPercent": {
"type": "number"
"type": "number",
"description": "How much of this month's allowance is used (0–100)"
},
"usedInputTokens": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
],
"description": "Input tokens used this month by all the church's products (null from a Hub before 2.0.1)"
},
"usedOutputTokens": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
],
"description": "Output tokens used this month"
},
"capInputTokens": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
],
"description": "About how many input tokens the monthly allowance holds, if half of it went on input (an estimate: cached prompts cost less)"
},
"capOutputTokens": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
],
"description": "About how many output tokens the allowance holds, if half of it went on output"
},
"renewsOn": {
"description": "YYYY-MM-DD",
@@ -68531,9 +68741,11 @@
"enabled",
"capReached",
"available",
"capCents",
"usedCents",
"usedPercent",
"usedInputTokens",
"usedOutputTokens",
"capInputTokens",
"capOutputTokens",
"renewsOn",
"helpers"
],
@@ -68677,16 +68889,61 @@
"type": "boolean",
"description": "false: the Hub couldn't be reached just now"
},
"capCents": {
"type": "number",
"description": "The monthly allowance, in cents"
},
"usedCents": {
"type": "number",
"description": "Used this month, in cents (fractions of a cent)"
},
"usedPercent": {
"type": "number"
"type": "number",
"description": "How much of this month's allowance is used (0–100)"
},
"usedInputTokens": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
],
"description": "Input tokens used this month by all the church's products (null from a Hub before 2.0.1)"
},
"usedOutputTokens": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
],
"description": "Output tokens used this month"
},
"capInputTokens": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
],
"description": "About how many input tokens the monthly allowance holds, if half of it went on input (an estimate: cached prompts cost less)"
},
"capOutputTokens": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
],
"description": "About how many output tokens the allowance holds, if half of it went on output"
},
"renewsOn": {
"description": "YYYY-MM-DD",
@@ -68729,9 +68986,11 @@
"enabled",
"capReached",
"available",
"capCents",
"usedCents",
"usedPercent",
"usedInputTokens",
"usedOutputTokens",
"capInputTokens",
"capOutputTokens",
"renewsOn",
"helpers"
],
@@ -68916,16 +69175,61 @@
"type": "boolean",
"description": "false: the Hub couldn't be reached just now"
},
"capCents": {
"type": "number",
"description": "The monthly allowance, in cents"
},
"usedCents": {
"type": "number",
"description": "Used this month, in cents (fractions of a cent)"
},
"usedPercent": {
"type": "number"
"type": "number",
"description": "How much of this month's allowance is used (0–100)"
},
"usedInputTokens": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
],
"description": "Input tokens used this month by all the church's products (null from a Hub before 2.0.1)"
},
"usedOutputTokens": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
],
"description": "Output tokens used this month"
},
"capInputTokens": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
],
"description": "About how many input tokens the monthly allowance holds, if half of it went on input (an estimate: cached prompts cost less)"
},
"capOutputTokens": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
],
"description": "About how many output tokens the allowance holds, if half of it went on output"
},
"renewsOn": {
"description": "YYYY-MM-DD",
@@ -68968,9 +69272,11 @@
"enabled",
"capReached",
"available",
"capCents",
"usedCents",
"usedPercent",
"usedInputTokens",
"usedOutputTokens",
"capInputTokens",
"capOutputTokens",
"renewsOn",
"helpers"
],
@@ -69122,16 +69428,61 @@
"type": "boolean",
"description": "false: the Hub couldn't be reached just now"
},
"capCents": {
"type": "number",
"description": "The monthly allowance, in cents"
},
"usedCents": {
"type": "number",
"description": "Used this month, in cents (fractions of a cent)"
},
"usedPercent": {
"type": "number"
"type": "number",
"description": "How much of this month's allowance is used (0–100)"
},
"usedInputTokens": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
],
"description": "Input tokens used this month by all the church's products (null from a Hub before 2.0.1)"
},
"usedOutputTokens": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
],
"description": "Output tokens used this month"
},
"capInputTokens": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
],
"description": "About how many input tokens the monthly allowance holds, if half of it went on input (an estimate: cached prompts cost less)"
},
"capOutputTokens": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
],
"description": "About how many output tokens the allowance holds, if half of it went on output"
},
"renewsOn": {
"description": "YYYY-MM-DD",
@@ -69174,9 +69525,11 @@
"enabled",
"capReached",
"available",
"capCents",
"usedCents",
"usedPercent",
"usedInputTokens",
"usedOutputTokens",
"capInputTokens",
"capOutputTokens",
"renewsOn",
"helpers"
],
+69 -31
View File
@@ -37676,11 +37676,16 @@ export interface operations {
capReached: boolean;
/** @description false: the Hub couldn't be reached just now */
available: boolean;
/** @description The monthly allowance, in cents */
capCents: number;
/** @description Used this month, in cents (fractions of a cent) */
usedCents: number;
/** @description How much of this month's allowance is used (0–100) */
usedPercent: number;
/** @description Input tokens used this month by all the church's products (null from a Hub before 2.0.1) */
usedInputTokens: number | null;
/** @description Output tokens used this month */
usedOutputTokens: number | null;
/** @description About how many input tokens the monthly allowance holds, if half of it went on input (an estimate: cached prompts cost less) */
capInputTokens: number | null;
/** @description About how many output tokens the allowance holds, if half of it went on output */
capOutputTokens: number | null;
/** @description YYYY-MM-DD */
renewsOn: string | null;
/** @description Each helper switched on or off in Site settings → AI */
@@ -37739,11 +37744,16 @@ export interface operations {
capReached: boolean;
/** @description false: the Hub couldn't be reached just now */
available: boolean;
/** @description The monthly allowance, in cents */
capCents: number;
/** @description Used this month, in cents (fractions of a cent) */
usedCents: number;
/** @description How much of this month's allowance is used (0–100) */
usedPercent: number;
/** @description Input tokens used this month by all the church's products (null from a Hub before 2.0.1) */
usedInputTokens: number | null;
/** @description Output tokens used this month */
usedOutputTokens: number | null;
/** @description About how many input tokens the monthly allowance holds, if half of it went on input (an estimate: cached prompts cost less) */
capInputTokens: number | null;
/** @description About how many output tokens the allowance holds, if half of it went on output */
capOutputTokens: number | null;
/** @description YYYY-MM-DD */
renewsOn: string | null;
/** @description Each helper switched on or off in Site settings → AI */
@@ -37768,18 +37778,21 @@ export interface operations {
};
people: {
uses: number;
chargedCents: number;
inputTokens: number;
outputTokens: number;
userId: string | null;
name: string;
}[];
helpers: {
uses: number;
chargedCents: number;
inputTokens: number;
outputTokens: number;
helper: string;
}[];
days: {
uses: number;
chargedCents: number;
inputTokens: number;
outputTokens: number;
day: string;
}[];
};
@@ -37945,11 +37958,16 @@ export interface operations {
capReached: boolean;
/** @description false: the Hub couldn't be reached just now */
available: boolean;
/** @description The monthly allowance, in cents */
capCents: number;
/** @description Used this month, in cents (fractions of a cent) */
usedCents: number;
/** @description How much of this month's allowance is used (0–100) */
usedPercent: number;
/** @description Input tokens used this month by all the church's products (null from a Hub before 2.0.1) */
usedInputTokens: number | null;
/** @description Output tokens used this month */
usedOutputTokens: number | null;
/** @description About how many input tokens the monthly allowance holds, if half of it went on input (an estimate: cached prompts cost less) */
capInputTokens: number | null;
/** @description About how many output tokens the allowance holds, if half of it went on output */
capOutputTokens: number | null;
/** @description YYYY-MM-DD */
renewsOn: string | null;
/** @description Each helper switched on or off in Site settings → AI */
@@ -38041,11 +38059,16 @@ export interface operations {
capReached: boolean;
/** @description false: the Hub couldn't be reached just now */
available: boolean;
/** @description The monthly allowance, in cents */
capCents: number;
/** @description Used this month, in cents (fractions of a cent) */
usedCents: number;
/** @description How much of this month's allowance is used (0–100) */
usedPercent: number;
/** @description Input tokens used this month by all the church's products (null from a Hub before 2.0.1) */
usedInputTokens: number | null;
/** @description Output tokens used this month */
usedOutputTokens: number | null;
/** @description About how many input tokens the monthly allowance holds, if half of it went on input (an estimate: cached prompts cost less) */
capInputTokens: number | null;
/** @description About how many output tokens the allowance holds, if half of it went on output */
capOutputTokens: number | null;
/** @description YYYY-MM-DD */
renewsOn: string | null;
/** @description Each helper switched on or off in Site settings → AI */
@@ -38127,11 +38150,16 @@ export interface operations {
capReached: boolean;
/** @description false: the Hub couldn't be reached just now */
available: boolean;
/** @description The monthly allowance, in cents */
capCents: number;
/** @description Used this month, in cents (fractions of a cent) */
usedCents: number;
/** @description How much of this month's allowance is used (0–100) */
usedPercent: number;
/** @description Input tokens used this month by all the church's products (null from a Hub before 2.0.1) */
usedInputTokens: number | null;
/** @description Output tokens used this month */
usedOutputTokens: number | null;
/** @description About how many input tokens the monthly allowance holds, if half of it went on input (an estimate: cached prompts cost less) */
capInputTokens: number | null;
/** @description About how many output tokens the allowance holds, if half of it went on output */
capOutputTokens: number | null;
/** @description YYYY-MM-DD */
renewsOn: string | null;
/** @description Each helper switched on or off in Site settings → AI */
@@ -38220,11 +38248,16 @@ export interface operations {
capReached: boolean;
/** @description false: the Hub couldn't be reached just now */
available: boolean;
/** @description The monthly allowance, in cents */
capCents: number;
/** @description Used this month, in cents (fractions of a cent) */
usedCents: number;
/** @description How much of this month's allowance is used (0–100) */
usedPercent: number;
/** @description Input tokens used this month by all the church's products (null from a Hub before 2.0.1) */
usedInputTokens: number | null;
/** @description Output tokens used this month */
usedOutputTokens: number | null;
/** @description About how many input tokens the monthly allowance holds, if half of it went on input (an estimate: cached prompts cost less) */
capInputTokens: number | null;
/** @description About how many output tokens the allowance holds, if half of it went on output */
capOutputTokens: number | null;
/** @description YYYY-MM-DD */
renewsOn: string | null;
/** @description Each helper switched on or off in Site settings → AI */
@@ -38313,11 +38346,16 @@ export interface operations {
capReached: boolean;
/** @description false: the Hub couldn't be reached just now */
available: boolean;
/** @description The monthly allowance, in cents */
capCents: number;
/** @description Used this month, in cents (fractions of a cent) */
usedCents: number;
/** @description How much of this month's allowance is used (0–100) */
usedPercent: number;
/** @description Input tokens used this month by all the church's products (null from a Hub before 2.0.1) */
usedInputTokens: number | null;
/** @description Output tokens used this month */
usedOutputTokens: number | null;
/** @description About how many input tokens the monthly allowance holds, if half of it went on input (an estimate: cached prompts cost less) */
capInputTokens: number | null;
/** @description About how many output tokens the allowance holds, if half of it went on output */
capOutputTokens: number | null;
/** @description YYYY-MM-DD */
renewsOn: string | null;
/** @description Each helper switched on or off in Site settings → AI */