(
- `/api/v1/usage/${encodeURIComponent(queryAgent)}/${encodeURIComponent(
- queryService
- )}`
+ `/api/v1/usage/${encodeURIComponent(parsedAgent.value)}/${encodeURIComponent(
+ parsedServiceId.value,
+ )}`,
);
setQueryResult({ kind: "ok", result: result ?? null });
} catch (error) {
@@ -108,7 +136,9 @@ export default function UsagePage() {
className="mx-auto flex min-h-screen max-w-2xl flex-col gap-12 p-8 focus:outline-none"
>
- Usage metering
+
+ Usage metering
+
Record per-request usage for an agent and query the running total.
@@ -119,26 +149,28 @@ export default function UsagePage() {
Record usage
{status.kind === "ok" && (
-
+
{typeof status.total === "number"
? `Recorded. New total: ${status.total}.`
: "Recorded."}
@@ -181,26 +216,28 @@ export default function UsagePage() {
Query usage