Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

fix(auto_charge): bad hourly counter logic (#1736)

Gergő Móricz8a282e3fc84b
diff --git a/apps/api/src/services/billing/auto_charge.ts b/apps/api/src/services/billing/auto_charge.ts
index 934d537e9..785534b4c 100644
--- a/apps/api/src/services/billing/auto_charge.ts
+++ b/apps/api/src/services/billing/auto_charge.ts
@@ -185,6 +185,7 @@ export async function autoCharge(
await redisRateLimitClient.expire(
hourlyCounterKey,
HOURLY_COUNTER_EXPIRY,
+ "NX",
);
try {