+ {counters.map((row) => (
+
{counterMathLine(row)}
+ ))}
+
Total: {formatCost(total)}
+
Per-unit prices come from the bedrock/guardrails entry in the cost map.
+
+);
+
+const UnitsMath = ({ units }: { units: GuardrailUsageDetail["usage_units"] }) => (
+
+
{unitsSumLine(units)}
+
+ Bedrock reports one unit per 1,000 characters of the message for each policy the guardrail has on, on every call,
+ blocked or not.
+
+
+);
+
const TableHeading = ({ title }: { title: string }) => (
+ {rows
+ .filter((row) => row.cost != null)
+ .map((row) => (
+
+ {row.name}: {formatCost(row.cost)}
+
+ ))}
+
Total: {formatCost(total)}
+
+ {`Each guardrail's cost is its units per policy × that policy's per-unit price from the cost map, added up${
+ unpriced ? `; ${unpriced} had no known price and are left out` : ""
+ }. Open a guardrail for its per-policy math.`}
+
+
+ );
+}
+
function CostCell({ row }: { row: GuardrailUsageOverviewRow }) {
const unpriced = unpricedSummary(row.untrackedUsageUnits);
return (
@@ -124,6 +152,25 @@ export function GuardrailsOverview({
const error = guardrailsError;
const columns: ColumnDef