Skip to content

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

fix(credit_billing): allow spending of exact credits

Gergő Móriczeb7317c08a82
diff --git a/apps/api/src/services/billing/credit_billing.ts b/apps/api/src/services/billing/credit_billing.ts
index 6fa349062..56de74e52 100644
--- a/apps/api/src/services/billing/credit_billing.ts
+++ b/apps/api/src/services/billing/credit_billing.ts
@@ -63,7 +63,7 @@ export async function supaCheckTeamCredits(chunk: AuthCreditUsageChunk, team_id:
const creditUsagePercentage = creditsWillBeUsed / chunk.price_credits;
// Compare the adjusted total credits used with the credits allowed by the plan
- if (creditsWillBeUsed >= chunk.price_credits) {
+ if (creditsWillBeUsed > chunk.price_credits) {
sendNotification(
team_id,
NotificationType.LIMIT_REACHED,