improvement(pricing): increase free user limit to 20 usd (#2536)

* improvement(pricing): increase free user limit to 20 usd

* make gemini pricing accurate

* generate migration for db constant

* update docs

* test notif data
This commit is contained in:
Vikhyath Mondreti
2025-12-22 19:51:22 -08:00
committed by GitHub
parent be9ab4c833
commit 6af291ca9f
8 changed files with 8485 additions and 26 deletions

View File

@@ -6,7 +6,7 @@
/**
* Default free credits (in dollars) for new users
*/
export const DEFAULT_FREE_CREDITS = 10
export const DEFAULT_FREE_CREDITS = 20
/**
* Storage limit constants (in GB)

View File

@@ -0,0 +1 @@
ALTER TABLE "user_stats" ALTER COLUMN "current_usage_limit" SET DEFAULT '20';

File diff suppressed because it is too large Load Diff

View File

@@ -911,6 +911,13 @@
"when": 1766433914366,
"tag": "0130_bored_master_chief",
"breakpoints": true
},
{
"idx": 131,
"version": "7",
"when": 1766460889694,
"tag": "0131_illegal_nova",
"breakpoints": true
}
]
}

View File

@@ -653,7 +653,7 @@ export const userStats = pgTable('user_stats', {
totalChatExecutions: integer('total_chat_executions').notNull().default(0),
totalTokensUsed: integer('total_tokens_used').notNull().default(0),
totalCost: decimal('total_cost').notNull().default('0'),
currentUsageLimit: decimal('current_usage_limit').default(DEFAULT_FREE_CREDITS.toString()), // Default $10 for free plan, null for team/enterprise
currentUsageLimit: decimal('current_usage_limit').default(DEFAULT_FREE_CREDITS.toString()), // Default $20 for free plan, null for team/enterprise
usageLimitUpdatedAt: timestamp('usage_limit_updated_at').defaultNow(),
// Billing period tracking
currentPeriodCost: decimal('current_period_cost').notNull().default('0'), // Usage in current billing period