Skip to content

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

Update credit_billing.ts

Nicolasfbdfa1256bb6
diff --git a/apps/api/src/services/billing/credit_billing.ts b/apps/api/src/services/billing/credit_billing.ts
index d22f03727..6a71b40a4 100644
--- a/apps/api/src/services/billing/credit_billing.ts
+++ b/apps/api/src/services/billing/credit_billing.ts
@@ -308,7 +308,7 @@ export async function supaCheckTeamCredits(team_id: string, credits: number) {
}
// 5. Compare the total credits used with the credits allowed by the plan.
- if (totalCreditsUsed > FREE_CREDITS) {
+ if (totalCreditsUsed >= FREE_CREDITS) {
// Send email notification for insufficient credits
await sendNotification(
team_id,
@@ -405,7 +405,7 @@ export async function supaCheckTeamCredits(team_id: string, credits: number) {
const creditUsagePercentage = adjustedCreditsUsed / creditLimit;
// Compare the adjusted total credits used with the credits allowed by the plan
- if (adjustedCreditsUsed > price.credits) {
+ if (adjustedCreditsUsed >= price.credits) {
await sendNotification(
team_id,
NotificationType.LIMIT_REACHED,