Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥
TypeScript aiai-agentsai-crawlerai-scrapingai-searchcrawlerdata-extractionhtml-to-markdownllmmarkdownscraperscrapingweb-crawlerweb-dataweb-data-extractionweb-scraperweb-scrapingweb-searchwebscraping
fix(credit_billing): return chunk.remaining_credits
Gergő Móriczc1f68c3e0ae5
diff --git a/apps/api/src/services/billing/credit_billing.ts b/apps/api/src/services/billing/credit_billing.tsindex 12e6b1700..48dd3a17f 100644--- a/apps/api/src/services/billing/credit_billing.ts+++ b/apps/api/src/services/billing/credit_billing.ts@@ -191,7 +191,7 @@ export async function supaCheckTeamCredits(chunk: AuthCreditUsageChunk, team_id:chunk.sub_current_period_start,chunk.sub_current_period_end);- return { success: false, message: "Insufficient credits, please upgrade!", remainingCredits: chunk.price_credits - chunk.adjusted_credits_used, chunk };+ return { success: false, message: "Insufficient credits, please upgrade!", remainingCredits: chunk.remaining_credits, chunk };} else if (creditUsagePercentage >= 0.8 && creditUsagePercentage < 1) {// Send email notification for approaching credit limitsendNotification(@@ -202,7 +202,7 @@ export async function supaCheckTeamCredits(chunk: AuthCreditUsageChunk, team_id:);}- return { success: true, message: "Sufficient credits available", remainingCredits: chunk.price_credits - chunk.adjusted_credits_used, chunk };+ return { success: true, message: "Sufficient credits available", remainingCredits: chunk.remaining_credits, chunk };}// Count the total credits used by a team within the current billing period and return the remaining credits.