Skip to content

Open-source agentic AI Search Execution Platform. Track AI visibility, find opportunities, and let agents turn signals into prioritized actions and drafted fixes across ChatGPT, Claude, Gemini, Google AI Overviews, Google AI Mode, Perplexity, Grok, and Microsoft Copilot.

feat(billing): one AI budget of $5 / $25 / $50 a month, $1 in the free trial (AI usage display, part 5) (#1435)

Cihan3f2f571e447a
diff --git a/server/src/config/plans.js b/server/src/config/plans.js
index 6f2358028..4ec1923a0 100644
--- a/server/src/config/plans.js
+++ b/server/src/config/plans.js
@@ -52,12 +52,12 @@ export const PLANS = {
maxDomainsPerBrand: 3,
maxVolumeAnalyses: 4,
maxBriefGenerations: 10,
- // AI usage, in tiers the billing cards show as multiples of Starter's:
- // $1 here (1x), Growth $5 (5x), Enterprise $10 or 1% of its contract.
- // Spent on Improve and, later, the Content Editor's AI. Starter's is a
- // trial: enough for a few generations a month (Growth+ was PROMPT-003's
- // call).
- improveMonthlyBudgetUsd: 1,
+ // The workspace's one AI budget (Improve, the Content Editor's AI and
+ // the Action Center's task writing), in tiers the billing cards show as
+ // multiples of Starter's: $5 here (1x), Growth $25 (5x), Enterprise $50
+ // or 1% of its contract (2026-10-24); the free trial gets
+ // TRIAL_AI_BUDGET_USD.
+ improveMonthlyBudgetUsd: 5,
// 0.1% of the $49 price, spent rating suggestions' relevance (VIS-011).
relevanceMonthlyBudgetUsd: 0.049,
maxOpportunitiesPerMonth: 10,
@@ -101,8 +101,8 @@ export const PLANS = {
maxDomainsPerBrand: 10,
maxVolumeAnalyses: 10,
maxBriefGenerations: 50,
- // AI usage: 5x Starter's $1 (the billing card's "5x AI usage").
- improveMonthlyBudgetUsd: 5,
+ // AI usage: 5x Starter's $5 (the billing card's "5x AI usage").
+ improveMonthlyBudgetUsd: 25,
// 0.1% of the $249 price, spent rating suggestions' relevance (VIS-011).
relevanceMonthlyBudgetUsd: 0.249,
maxOpportunitiesPerMonth: 50,
@@ -144,10 +144,10 @@ export const PLANS = {
maxVolumeAnalyses: -1,
// Per-customer: override via organizations.plan_overrides in the DB.
maxBriefGenerations: -1,
- // AI usage: $10 at the least, above Growth's $5.
+ // AI usage: $50 at the least, twice Growth's $25.
// plan_overrides.contractMonthlyUsd raises it to 1% of the contract; an
// explicit plan_overrides.improveMonthlyBudgetUsd wins.
- improveMonthlyBudgetUsd: 10,
+ improveMonthlyBudgetUsd: 50,
// 0.1% of the $499 floor, raised to 0.1% of contractMonthlyUsd; an
// explicit plan_overrides.relevanceMonthlyBudgetUsd wins.
relevanceMonthlyBudgetUsd: 0.499,
@@ -183,6 +183,12 @@ export const PLANS = {
},
};
+/**
+ * The free trial's AI budget, whatever the plan (2026-10-24): the plan's own
+ * comes once the subscription is paid. See applyTrialAiBudget.
+ */
+export const TRIAL_AI_BUDGET_USD = 1;
+
export function isCloud() {
return process.env.IS_CLOUD === 'true';
}
diff --git a/server/src/lib/plan-guard-ai-budget.test.js b/server/src/lib/plan-guard-ai-budget.test.js
index 79ce1770f..35d0d106c 100644
--- a/server/src/lib/plan-guard-ai-budget.test.js
+++ b/server/src/lib/plan-guard-ai-budget.test.js
@@ -105,8 +105,8 @@ describe('reserveAiBudget', () => {
fn: 'reserve_ai_usage',
args: expect.objectContaining({
p_organization_id: 'o1',
- // Starter's $1, from the period's start.
- p_budget: 1,
+ // Starter's $5, from the period's start.
+ p_budget: 5,
p_since: expect.any(String),
p_cost: 0.0095,
p_feature: 'content',
@@ -159,6 +159,21 @@ describe('reserveAiBudget', () => {
expect(ops).toEqual([]);
});
+ it('holds a call in the free trial on its $1, and says starting the plan gives more', async () => {
+ org = { ...org, plan: 'growth', subscription_status: 'trialing' };
+ await guard.reserveAiBudget('o1', { feature: 'improve', modelId: 'm', promptId: 'p1' });
+ expect(rpcCalls[0].args.p_budget).toBe(1);
+
+ reserved = null;
+ await expect(
+ guard.reserveAiBudget('o1', { feature: 'improve', modelId: 'm', promptId: 'p1' }),
+ ).rejects.toMatchObject({
+ statusCode: 429,
+ message:
+ "The free trial's AI usage is used up. Starting the plan gives its full monthly allowance.",
+ });
+ });
+
it('refuses once the budget is spent, as the quota did', async () => {
reserved = null;
await expect(
diff --git a/server/src/lib/plan-guard-ai-usage.test.js b/server/src/lib/plan-guard-ai-usage.test.js
index dc3618807..cc84f3ef6 100644
--- a/server/src/lib/plan-guard-ai-usage.test.js
+++ b/server/src/lib/plan-guard-ai-usage.test.js
@@ -72,10 +72,10 @@ afterEach(() => {
describe('getAiUsage', () => {
it('reads the period’s spend by feature as shares of the plan’s budget', async () => {
- // Starter's budget is $1.
+ // Starter's budget is $5.
spend = [
- { feature: 'improve', cost_usd: '0.125' },
- { feature: 'content', cost_usd: '0.3004' },
+ { feature: 'improve', cost_usd: '0.625' },
+ { feature: 'content', cost_usd: '1.502' },
];
const usage = await guard.getAiUsage('o1');
expect(rpcCalls).toEqual([
@@ -101,8 +101,8 @@ describe('getAiUsage', () => {
it('reads spend past the budget as all of it, the features scaled to fit', async () => {
spend = [
- { feature: 'content', cost_usd: '1.5' },
- { feature: 'action_center', cost_usd: '0.5' },
+ { feature: 'content', cost_usd: '7.5' },
+ { feature: 'action_center', cost_usd: '2.5' },
];
const usage = await guard.getAiUsage('o1');
expect(usage.percentUsed).toBe(100);
@@ -114,7 +114,7 @@ describe('getAiUsage', () => {
});
it('lists spend it can’t place only when there is some', async () => {
- spend = [{ feature: 'other', cost_usd: '0.05' }];
+ spend = [{ feature: 'other', cost_usd: '0.25' }];
expect((await guard.getAiUsage('o1')).features).toContainEqual({
feature: 'other',
percent: 5,
@@ -126,16 +126,16 @@ describe('getAiUsage', () => {
});
it('reads just under the budget as just under, and all of it only once spent', async () => {
- spend = [{ feature: 'improve', cost_usd: '0.9996' }];
+ spend = [{ feature: 'improve', cost_usd: '4.998' }];
expect((await guard.getAiUsage('o1')).percentUsed).toBe(99.9);
- spend = [{ feature: 'improve', cost_usd: '1' }];
+ spend = [{ feature: 'improve', cost_usd: '5' }];
expect((await guard.getAiUsage('o1')).percentUsed).toBe(100);
});
it('scales unknown spend with the rest when past the budget', async () => {
spend = [
- { feature: 'improve', cost_usd: '1.5' },
- { feature: 'other', cost_usd: '0.5' },
+ { feature: 'improve', cost_usd: '7.5' },
+ { feature: 'other', cost_usd: '2.5' },
];
const usage = await guard.getAiUsage('o1');
expect(usage.features).toContainEqual({ feature: 'improve', percent: 75 });
@@ -167,9 +167,9 @@ describe('getAiUsage', () => {
describe('getDraftAiUsage', () => {
it('reads the page’s spend this period as a share of the budget, from the org’s own rows', async () => {
- // Starter's budget is $1: 0.0371 is 3.7%.
- pageRows = [{ cost_usd: '0.0250' }, { cost_usd: '0.0121' }];
- spend = [{ feature: 'content', cost_usd: '0.2' }];
+ // Starter's budget is $5: 0.185 is 3.7%.
+ pageRows = [{ cost_usd: '0.125' }, { cost_usd: '0.06' }];
+ spend = [{ feature: 'content', cost_usd: '1' }];
expect(await guard.getDraftAiUsage('o1', 'd1')).toEqual({ unlimited: false, percent: 3.7 });
expect(pageFilters).toEqual([
['eq', 'organization_id', 'o1'],
@@ -181,7 +181,7 @@ describe('getDraftAiUsage', () => {
it('reads a page with no AI calls as 0, and one with a sliver as 0.1', async () => {
expect(await guard.getDraftAiUsage('o1', 'd1')).toEqual({ unlimited: false, percent: 0 });
- // A small Fix run on a big budget: $0.005 of Enterprise's $10.
+ // A small Fix run on a big budget: $0.005 of Enterprise's $50.
org = { ...org, plan: 'enterprise' };
pageRows = [{ cost_usd: '0.005' }];
spend = [{ feature: 'content', cost_usd: '0.005' }];
@@ -189,12 +189,12 @@ describe('getDraftAiUsage', () => {
});
it('scales the page’s spend to fit once the month’s is past the budget, as the month’s figure', async () => {
- // The last call took the month to $1.07 of Starter's $1, all on this page.
- pageRows = [{ cost_usd: '1.07' }];
- spend = [{ feature: 'content', cost_usd: '1.07' }];
+ // The last call took the month to $5.35 of Starter's $5, all on this page.
+ pageRows = [{ cost_usd: '5.35' }];
+ spend = [{ feature: 'content', cost_usd: '5.35' }];
expect(await guard.getDraftAiUsage('o1', 'd1')).toEqual({ unlimited: false, percent: 100 });
// Half of it on this page.
- pageRows = [{ cost_usd: '0.535' }];
+ pageRows = [{ cost_usd: '2.675' }];
expect(await guard.getDraftAiUsage('o1', 'd1')).toEqual({ unlimited: false, percent: 50 });
});
@@ -209,3 +209,36 @@ describe('getDraftAiUsage', () => {
expect(pageFilters).toEqual([]);
});
});
+
+describe('the free trial’s AI budget', () => {
+ it('is $1 whatever the plan while the subscription is trialing, and says it is the trial’s', async () => {
+ org = { ...org, plan: 'growth', subscription_status: 'trialing' };
+ spend = [{ feature: 'content', cost_usd: '0.21' }];
+ expect(await guard.getAiUsage('o1')).toMatchObject({ trial: true, percentUsed: 21 });
+ // Paid: Growth's own $25.
+ org = { ...org, subscription_status: 'active' };
+ expect(await guard.getAiUsage('o1')).toMatchObject({ trial: false, percentUsed: 0.8 });
+ });
+
+ it('leaves Enterprise with its own (a deal’s budget or contract), and an unlimited one as it is', () => {
+ const plan = (budget) => ({ id: 'x', limits: { improveMonthlyBudgetUsd: budget } });
+ const trialing = (over) => ({ plan: 'starter', subscription_status: 'trialing', ...over });
+ const contract = trialing({ plan: 'enterprise', plan_overrides: { contractMonthlyUsd: 8000 } });
+ expect(guard.applyTrialAiBudget(plan(80), contract)).toEqual(plan(80));
+ expect(guard.applyTrialAiBudget(plan(-1), trialing())).toEqual(plan(-1));
+ });
+
+ it('holds Starter and Growth trials to $1, and a smaller budget to its own', () => {
+ const plan = (budget) => ({ id: 'x', limits: { improveMonthlyBudgetUsd: budget } });
+ const trial = { plan: 'growth', subscription_status: 'trialing' };
+ expect(guard.applyTrialAiBudget(plan(25), trial)).toEqual({
+ id: 'x',
+ trial: true,
+ limits: { improveMonthlyBudgetUsd: 1 },
+ });
+ expect(guard.applyTrialAiBudget(plan(0.5), trial).limits.improveMonthlyBudgetUsd).toBe(0.5);
+ expect(guard.applyTrialAiBudget(plan(25), { ...trial, subscription_status: 'active' })).toEqual(
+ plan(25),
+ );
+ });
+});
diff --git a/server/src/lib/plan-guard.js b/server/src/lib/plan-guard.js
index 7758300ef..7781df905 100644
--- a/server/src/lib/plan-guard.js
+++ b/server/src/lib/plan-guard.js
@@ -5,6 +5,7 @@ import {
isWithinLimit,
isCloud,
isSubscriptionActive,
+ TRIAL_AI_BUDGET_USD,
} from '../config/plans.js';
import { anchoredPeriodStart, shiftMonthClamped } from './quota-period.js';
import {
@@ -95,7 +96,24 @@ async function resolveOrgPlanByOrgId(orgId) {
);
}
- return applyPlanOverrides(getPlan(org.plan), org);
+ return applyTrialAiBudget(applyPlanOverrides(getPlan(org.plan), org), org);
+}
+
+/**
+ * The free trial's AI budget: while the subscription is trialing, the plan's
+ * AI budget is TRIAL_AI_BUDGET_USD at most, and the plan's own comes once it
+ * is paid; `trial` marks the plan so what reads it can say so. Enterprise
+ * keeps its own: its trials are a deal's, with its budget or contract.
+ */
+export function applyTrialAiBudget(plan, org) {
+ if (org?.subscription_status !== 'trialing' || org.plan === 'enterprise') return plan;
+ const budget = plan.limits.improveMonthlyBudgetUsd ?? -1;
+ if (budget === -1) return plan;
+ return {
+ ...plan,
+ trial: true,
+ limits: { ...plan.limits, improveMonthlyBudgetUsd: Math.min(budget, TRIAL_AI_BUDGET_USD) },
+ };
}
/**
@@ -325,10 +343,10 @@ async function improveSpendThisPeriod(orgId) {
/**
* Improve-tab budget (PROMPT-003): a monthly USD budget per organization
- * (plan.limits.improveMonthlyBudgetUsd: Starter $1, Growth $5, Enterprise
- * $10 or 1% of its contract), charged with each generation's real token
- * cost so the budget holds for any model. Users
- * see an estimate of generations left, not dollars. -1 is unlimited.
+ * (plan.limits.improveMonthlyBudgetUsd: Starter $5, Growth $25, Enterprise
+ * $50 or 1% of its contract, the free trial $1), charged with each
+ * generation's real token cost so the budget holds for any model. Users see
+ * an estimate of generations left, not dollars. -1 is unlimited.
*/
export async function getImproveQuotaStatus(orgId, modelId) {
const plan = await resolveOrgPlanByOrgId(orgId);
@@ -339,6 +357,7 @@ export async function getImproveQuotaStatus(orgId, modelId) {
return {
unlimited: false,
planName: plan.name,
+ trial: plan.trial === true,
budgetUsd: budget,
spentUsd: spent,
remainingUsd: remaining,
@@ -389,7 +408,9 @@ export async function reserveAiBudget(
if (error) throw new Error(error.message);
if (!data) {
throw new PlanLimitError(
- `This month's suggestion budget on the ${plan.name} plan is used up. It resets when your subscription renews.`,
+ plan.trial
+ ? "The free trial's AI usage is used up. Starting the plan gives its full monthly allowance."
+ : `This month's suggestion budget on the ${plan.name} plan is used up. It resets when your subscription renews.`,
429,
);
}
@@ -501,6 +522,8 @@ export async function getAiUsage(orgId) {
const base = {
plan: plan.id,
planName: plan.name,
+ // The free trial's smaller budget: getting more means starting the plan.
+ trial: plan.trial === true,
periodStart: periodStart.toISOString(),
periodEnd: shiftMonthClamped(periodStart, 1).toISOString(),
};
diff --git a/server/src/lib/prompt-improve.test.js b/server/src/lib/prompt-improve.test.js
index 2a7d2103f..de2ec865d 100644
--- a/server/src/lib/prompt-improve.test.js
+++ b/server/src/lib/prompt-improve.test.js
@@ -311,14 +311,15 @@ describe('improveRangeKey', () => {
});
describe('Improve plan limits', () => {
- it('is on every plan, in AI usage tiers: Starter $1, Growth $5 (5x), Enterprise $10', async () => {
- const { PLANS } = await import('../config/plans.js');
- expect(PLANS.starter.limits.improveMonthlyBudgetUsd).toBe(1);
+ it('is on every plan, in one AI budget: Starter $5, Growth $25 (5x), Enterprise $50, the trial $1', async () => {
+ const { PLANS, TRIAL_AI_BUDGET_USD } = await import('../config/plans.js');
+ expect(PLANS.starter.limits.improveMonthlyBudgetUsd).toBe(5);
+ expect(TRIAL_AI_BUDGET_USD).toBe(1);
for (const id of ['starter', 'growth', 'enterprise', 'self_hosted']) {
expect(PLANS[id].limits.features).toContain('prompt_improve');
}
- expect(PLANS.growth.limits.improveMonthlyBudgetUsd).toBe(5);
- expect(PLANS.enterprise.limits.improveMonthlyBudgetUsd).toBe(10);
+ expect(PLANS.growth.limits.improveMonthlyBudgetUsd).toBe(25);
+ expect(PLANS.enterprise.limits.improveMonthlyBudgetUsd).toBe(50);
expect(PLANS.self_hosted.limits.improveMonthlyBudgetUsd).toBe(-1);
});
});
diff --git a/server/src/routes/billing.js b/server/src/routes/billing.js
index 52be11964..9cd13d60a 100644
--- a/server/src/routes/billing.js
+++ b/server/src/routes/billing.js
@@ -36,6 +36,7 @@ router.get('/ai-usage', async (req, res) => {
return res.json({
plan: 'self_hosted',
planName: null,
+ trial: false,
periodStart: null,
periodEnd: null,
unlimited: true,
diff --git a/server/src/routes/prompts.js b/server/src/routes/prompts.js
index 5a9db0488..971b65f68 100644
--- a/server/src/routes/prompts.js
+++ b/server/src/routes/prompts.js
@@ -1032,6 +1032,8 @@ function publicQuota(q) {
exhausted: q.remainingUsd <= 0,
generationsLeft: q.generationsLeft,
percentLeft: q.percentLeft,
+ // The free trial's: more comes with starting the plan, not a bigger one.
+ trial: q.trial === true,
};
}
diff --git a/web/messages/en.json b/web/messages/en.json
index 964b2a5a5..08820cb91 100644
--- a/web/messages/en.json
+++ b/web/messages/en.json
@@ -3878,7 +3878,7 @@
"aiUsedUp": "This month's AI usage is used up. It resets on {date}.",
"aiUsedUpNoDate": "This month's AI usage is used up until it resets.",
"fixErrors": {
- "ai_budget": "This month's AI usage is spent. Upgrade for more, or try again next month.",
+ "ai_budget": "This month's AI usage is spent. Upgrade for more, or try again once it resets.",
"no_subscription": "Content Agent needs an active subscription. Choose a plan in Settings › Billing.",
"empty": "Write something first: the agent improves the page you have.",
"open_suggestions": "This page has open suggestions, maybe from another tab. They're shown now: accept or reject them first.",
@@ -6170,7 +6170,8 @@
"left": "{count, plural, one {About # generation left this month} other {About # generations left this month}}",
"percentLeft": "{percent}% of this month's budget left",
"usedUp": "This month's suggestion budget is used up. It resets when your subscription renews.",
- "upgrade": "Upgrade for more"
+ "upgrade": "Upgrade for more",
+ "startPlan": "Start your plan"
}
}
},
@@ -6881,6 +6882,7 @@
"resets": "Resets on {date}",
"exhausted": "This period's AI usage is used up. AI features resume on {date}.",
"exhaustedNoDate": "This period's AI usage is used up. AI features resume when it resets.",
+ "exhaustedTrial": "The free trial's AI usage is used up. Starting the plan below gives its full monthly allowance.",
"morePlans": "A bigger plan below comes with more.",
"features": {
"improve": "Improve suggestions",
@@ -6992,7 +6994,7 @@
"briefs": "{count, number} content briefs a month",
"audits": "{count, number} site audits a month",
"aiUsage": "{count}x AI usage",
- "aiUsageHint": "A monthly allowance for Ansvisor's AI features: Improve suggestions, the Content Editor's AI and the Action Center's task writing. Agent Chat runs on your own AI key."
+ "aiUsageHint": "A monthly allowance for Ansvisor's AI features: Improve suggestions, the Content Editor's AI and the Action Center's task writing. Agent Chat runs on your own AI key. The free trial comes with a smaller allowance."
},
"contactUs": "Contact Us",
"integrations": "Integrations",
diff --git a/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/page.test.tsx b/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/page.test.tsx
index ac985fcfa..be43612e9 100644
--- a/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/page.test.tsx
+++ b/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/page.test.tsx
@@ -4562,7 +4562,7 @@ describe('the side panel', () => {
await act(async () => panelButton('Run Agent').click());
await act(async () => {});
expect(toast.error).toHaveBeenCalledWith(
- "This month's AI usage is spent. Upgrade for more, or try again next month.",
+ "This month's AI usage is spent. Upgrade for more, or try again once it resets.",
);
});
diff --git a/web/src/components/prompts/prompt-improve-tab.test.tsx b/web/src/components/prompts/prompt-improve-tab.test.tsx
index 3a7c1977f..8ec6dc4b0 100644
--- a/web/src/components/prompts/prompt-improve-tab.test.tsx
+++ b/web/src/components/prompts/prompt-improve-tab.test.tsx
@@ -78,7 +78,7 @@ describe('the Improve tab’s budget', () => {
expect(container.querySelector('a[href="/dashboard/settings?tab=billing"]')).toBeNull();
});
- it('offers Starter the upgrade once its $1 trial is spent', async () => {
+ it('offers Starter the upgrade once its budget is spent', async () => {
await render(
{ unlimited: false, exhausted: true, generationsLeft: 0, percentLeft: 0 },
'starter',
@@ -91,6 +91,15 @@ describe('the Improve tab’s budget', () => {
expect(generateButton().disabled).toBe(true);
});
+ it('offers a plan in its free trial starting it, once the trial’s budget is spent', async () => {
+ await render(
+ { unlimited: false, exhausted: true, generationsLeft: 0, percentLeft: 0, trial: true },
+ 'growth',
+ );
+ const start = container.querySelector('a[href="/dashboard/settings?tab=billing"]')!;
+ expect(start.textContent).toBe('Start your plan');
+ });
+
it('says when the budget resets on a paid plan, with no upgrade', async () => {
await render(
{ unlimited: false, exhausted: true, generationsLeft: 0, percentLeft: 0 },
diff --git a/web/src/components/prompts/prompt-improve-tab.tsx b/web/src/components/prompts/prompt-improve-tab.tsx
index b03bc72f3..3d6fc47ae 100644
--- a/web/src/components/prompts/prompt-improve-tab.tsx
+++ b/web/src/components/prompts/prompt-improve-tab.tsx
@@ -446,8 +446,8 @@ function friendlyError(error: string | null, fallback = 'Failed to generate sugg
/**
* "About 185 generations left this month"; nothing on unlimited plans. A
- * spent budget says when it resets, and offers Starter, on its $1 trial,
- * the upgrade.
+ * spent budget says when it resets, and offers Starter the upgrade, and the
+ * free trial starting its plan.
*/
function QuotaNote({
quota,
@@ -472,14 +472,14 @@ function QuotaNote({
}
>
{quota.exhausted ? t('usedUp') : t('left', { count: quota.generationsLeft ?? 0 })}
- {quota.exhausted && planId === 'starter' && (
+ {quota.exhausted && (quota.trial || planId === 'starter') && (
<>
{' '}
<Link
href="/dashboard/settings?tab=billing"
className="font-medium text-foreground underline underline-offset-2"
>
- {t('upgrade')}
+ {quota.trial ? t('startPlan') : t('upgrade')}
</Link>
</>
)}
diff --git a/web/src/components/settings/ai-usage-card.test.tsx b/web/src/components/settings/ai-usage-card.test.tsx
index 92401d43b..0f6ca2ca6 100644
--- a/web/src/components/settings/ai-usage-card.test.tsx
+++ b/web/src/components/settings/ai-usage-card.test.tsx
@@ -89,6 +89,15 @@ describe('AiUsageCard', () => {
);
});
+ it('says the free trial’s is used up and starting the plan gives more, not a bigger plan', async () => {
+ vi.mocked(getAiUsage).mockResolvedValue(usage({ trial: true, percentUsed: 100 }));
+ await render();
+ expect(container.textContent).toContain(
+ "The free trial's AI usage is used up. Starting the plan below gives its full monthly allowance.",
+ );
+ expect(container.textContent).not.toContain('A bigger plan');
+ });
+
it('offers no bigger plan on Enterprise', async () => {
vi.mocked(getAiUsage).mockResolvedValue(usage({ plan: 'enterprise', percentUsed: 100 }));
await render();
diff --git a/web/src/components/settings/ai-usage-card.tsx b/web/src/components/settings/ai-usage-card.tsx
index 38e704a39..02ef58a24 100644
--- a/web/src/components/settings/ai-usage-card.tsx
+++ b/web/src/components/settings/ai-usage-card.tsx
@@ -104,9 +104,16 @@ export function AiUsageCard() {
</div>
{tone === 'exhausted' && (
<p className="mt-1.5 text-sm text-red-600 dark:text-red-400">
- {resets ? t('exhausted', { date: resets }) : t('exhaustedNoDate')}
- {/* Enterprise has no bigger plan to move to. */}
- {usage.plan !== 'enterprise' && <> {t('morePlans')}</>}
+ {/* In the free trial, more comes with starting the plan, not a bigger one. */}
+ {usage.trial ? (
+ t('exhaustedTrial')
+ ) : (
+ <>
+ {resets ? t('exhausted', { date: resets }) : t('exhaustedNoDate')}
+ {/* Enterprise has no bigger plan to move to. */}
+ {usage.plan !== 'enterprise' && <> {t('morePlans')}</>}
+ </>
+ )}
</p>
)}
</div>
diff --git a/web/src/config/plans.ts b/web/src/config/plans.ts
index a7326bdc5..7e267a7f3 100644
--- a/web/src/config/plans.ts
+++ b/web/src/config/plans.ts
@@ -45,8 +45,9 @@ export interface PlanLimits {
maxBriefGenerations: number;
/**
* Monthly USD budget for AI usage: Improve-tab model calls (Positions
- * panel, PROMPT-003) and, later, the Content Editor's AI. Starter $1,
- * Growth $5, Enterprise $10 (or 1% of its contract); the billing cards
+ * panel, PROMPT-003), the Content Editor's AI and the Action Center's task
+ * writing. Starter $5, Growth $25, Enterprise $50 (or 1% of its contract),
+ * and $1 in the free trial (the server's rule); the billing cards
* show them as multiples of Starter's. Enforced on the server from each
* call's real token cost so it holds whichever model is configured.
* -1 = unlimited (self-host).
@@ -168,12 +169,10 @@ export const PLANS: Record<PlanId, Plan> = {
maxDomainsPerBrand: 3,
maxVolumeAnalyses: 4,
maxBriefGenerations: 10,
- // AI usage, in tiers the billing cards show as multiples of Starter's:
- // $1 here (1x), Growth $5 (5x), Enterprise $10 or 1% of its contract.
- // Spent on Improve and, later, the Content Editor's AI. Starter's is a
- // trial: enough for a few generations a month (Growth+ was PROMPT-003's
- // call).
- improveMonthlyBudgetUsd: 1,
+ // The workspace's one AI budget, in tiers the billing cards show as
+ // multiples of Starter's: $5 here (1x), Growth $25 (5x), Enterprise $50
+ // or 1% of its contract (2026-10-24); the server gives the free trial $1.
+ improveMonthlyBudgetUsd: 5,
// 0.1% of the $49 price, spent rating suggestions' relevance (VIS-011).
relevanceMonthlyBudgetUsd: 0.049,
maxOpportunitiesPerMonth: 10,
@@ -201,7 +200,7 @@ export const PLANS: Record<PlanId, Plan> = {
// longer gates the feature — only "did you paste a key?" does.
// Self-host gets the feature unconditionally via env.
'ai_agent',
- // Improve on a $1 trial budget (above).
+ // Improve, on Starter's AI budget (above).
'prompt_improve',
],
},
@@ -220,8 +219,8 @@ export const PLANS: Record<PlanId, Plan> = {
maxDomainsPerBrand: 10,
maxVolumeAnalyses: 10,
maxBriefGenerations: 50,
- // AI usage: 5x Starter's $1 (the billing card's "5x AI usage").
- improveMonthlyBudgetUsd: 5,
+ // AI usage: 5x Starter's $5 (the billing card's "5x AI usage").
+ improveMonthlyBudgetUsd: 25,
// 0.1% of the $249 price, spent rating suggestions' relevance (VIS-011).
relevanceMonthlyBudgetUsd: 0.249,
maxOpportunitiesPerMonth: 50,
@@ -265,10 +264,10 @@ export const PLANS: Record<PlanId, Plan> = {
maxVolumeAnalyses: -1,
// Per-customer: override via organizations.plan_overrides in the DB.
maxBriefGenerations: -1,
- // AI usage: $10 at the least, above Growth's $5.
+ // AI usage: $50 at the least, twice Growth's $25.
// plan_overrides.contractMonthlyUsd raises it to 1% of the contract; an
// explicit plan_overrides.improveMonthlyBudgetUsd wins.
- improveMonthlyBudgetUsd: 10,
+ improveMonthlyBudgetUsd: 50,
// 0.1% of the $499 floor, raised to 0.1% of contractMonthlyUsd; an
// explicit plan_overrides.relevanceMonthlyBudgetUsd wins.
relevanceMonthlyBudgetUsd: 0.499,
diff --git a/web/src/lib/prompt-improve.ts b/web/src/lib/prompt-improve.ts
index d69ed6d9c..1f4bd9142 100644
--- a/web/src/lib/prompt-improve.ts
+++ b/web/src/lib/prompt-improve.ts
@@ -80,6 +80,8 @@ export interface ImproveQuota {
exhausted: boolean;
generationsLeft: number | null;
percentLeft: number | null;
+ /** The free trial's smaller allowance: more comes with starting the plan. */
+ trial?: boolean;
}
/** The panel's range as sent to the server: the resolved bounds plus the picked preset. */