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.

fix(billing): stop raising Enterprise's AI budget to 1% of its contract (#1577)

Cihan36e5cef42469
diff --git a/server/src/config/plans.js b/server/src/config/plans.js
index 4ec1923a0..36138c19c 100644
--- a/server/src/config/plans.js
+++ b/server/src/config/plans.js
@@ -55,7 +55,7 @@ export const PLANS = {
// 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
+ // or more, set per customer (2026-10-27); the free trial gets
// TRIAL_AI_BUDGET_USD.
improveMonthlyBudgetUsd: 5,
// 0.1% of the $49 price, spent rating suggestions' relevance (VIS-011).
@@ -144,9 +144,9 @@ export const PLANS = {
maxVolumeAnalyses: -1,
// Per-customer: override via organizations.plan_overrides in the DB.
maxBriefGenerations: -1,
- // 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.
+ // AI usage: $50 at the least, twice Growth's $25. Over that, Ansvisor
+ // sets a customer's own in plan_overrides.improveMonthlyBudgetUsd
+ // (2026-10-27); the contract's value doesn't raise it.
improveMonthlyBudgetUsd: 50,
// 0.1% of the $499 floor, raised to 0.1% of contractMonthlyUsd; an
// explicit plan_overrides.relevanceMonthlyBudgetUsd wins.
diff --git a/server/src/lib/improve-cost.js b/server/src/lib/improve-cost.js
index a51cf20a4..8da720f36 100644
--- a/server/src/lib/improve-cost.js
+++ b/server/src/lib/improve-cost.js
@@ -18,9 +18,6 @@ export const MODEL_PRICES = {
export const FALLBACK_PRICE = { input: 5, output: 25 };
-/** Share of an Enterprise contract's monthly value its AI usage budget may spend (plan-guard.js). */
-export const IMPROVE_BUDGET_SHARE = 0.01;
-
/**
* A typical generation, used to estimate "generations left" before an org
* has any history, and the least a call holds on the budget before it runs
diff --git a/server/src/lib/plan-guard-ai-usage.test.js b/server/src/lib/plan-guard-ai-usage.test.js
index 037c195e2..e44a76584 100644
--- a/server/src/lib/plan-guard-ai-usage.test.js
+++ b/server/src/lib/plan-guard-ai-usage.test.js
@@ -227,11 +227,11 @@ describe('the free trial’s AI budget', () => {
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', () => {
+ it('leaves Enterprise with its own (a deal’s budget), 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));
+ const deal = trialing({ plan: 'enterprise', plan_overrides: { improveMonthlyBudgetUsd: 80 } });
+ expect(guard.applyTrialAiBudget(plan(80), deal)).toEqual(plan(80));
expect(guard.applyTrialAiBudget(plan(-1), trialing())).toEqual(plan(-1));
});
diff --git a/server/src/lib/plan-guard.js b/server/src/lib/plan-guard.js
index 56b21b193..87ce12f3e 100644
--- a/server/src/lib/plan-guard.js
+++ b/server/src/lib/plan-guard.js
@@ -9,7 +9,6 @@ import {
} from '../config/plans.js';
import { anchoredPeriodStart, shiftMonthClamped } from './quota-period.js';
import {
- IMPROVE_BUDGET_SHARE,
estimateGenerationsLeft,
generationCostUsd,
medianCost,
@@ -38,12 +37,13 @@ export class PlanLimitError extends Error {
* Enterprise orgs can have per-customer limit overrides stored in
* organizations.plan_overrides (jsonb) — mirrors web getOrgPlan().
*
- * `contractMonthlyUsd` is the contract's monthly value, entered when the deal
- * is signed. It sets the Improve budget to 1% of the contract (never below
- * the plan default), unless `improveMonthlyBudgetUsd` is set explicitly,
- * which wins. The relevance
- * budget (VIS-011) follows the same rule at 0.1%, rounded down so it never
- * passes the share.
+ * The AI budget is the plan's $50 unless Ansvisor sets a customer's own in
+ * `improveMonthlyBudgetUsd` (2026-10-27: over $50, set per customer); the
+ * contract's value doesn't raise it. `contractMonthlyUsd` is the contract's
+ * monthly value, entered when the deal is signed. It sets the relevance
+ * budget (VIS-011) to 0.1% of the contract (never below the plan default),
+ * rounded down so it never passes the share, unless
+ * `relevanceMonthlyBudgetUsd` is set explicitly, which wins.
*/
export function applyPlanOverrides(plan, org) {
if (
@@ -55,12 +55,6 @@ export function applyPlanOverrides(plan, org) {
const overrides = org.plan_overrides;
const limits = { ...plan.limits, ...overrides };
const usd = Number(overrides.contractMonthlyUsd);
- if (overrides.improveMonthlyBudgetUsd === undefined && Number.isFinite(usd) && usd > 0) {
- limits.improveMonthlyBudgetUsd = Math.max(
- plan.limits.improveMonthlyBudgetUsd ?? 0,
- Math.round(usd * IMPROVE_BUDGET_SHARE * 100) / 100,
- );
- }
if (overrides.relevanceMonthlyBudgetUsd === undefined && Number.isFinite(usd) && usd > 0) {
limits.relevanceMonthlyBudgetUsd = Math.max(
plan.limits.relevanceMonthlyBudgetUsd ?? 0,
@@ -103,7 +97,7 @@ async function resolveOrgPlanByOrgId(orgId) {
* 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.
+ * keeps its own: its trials are a deal's, with its budget.
*/
export function applyTrialAiBudget(plan, org) {
if (org?.subscription_status !== 'trialing' || org.plan === 'enterprise') return plan;
@@ -346,7 +340,7 @@ async function improveSpendThisPeriod(orgId) {
/**
* Improve-tab budget (PROMPT-003): a monthly USD budget per organization
* (plan.limits.improveMonthlyBudgetUsd: Starter $5, Growth $25, Enterprise
- * $50 or 1% of its contract, the free trial $1), charged with each
+ * $50 or a customer's own set by Ansvisor, 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.
*/
diff --git a/server/src/lib/plan-guard.test.js b/server/src/lib/plan-guard.test.js
index 53fe2f7c4..9aedd301c 100644
--- a/server/src/lib/plan-guard.test.js
+++ b/server/src/lib/plan-guard.test.js
@@ -47,7 +47,7 @@ describe('applyPlanOverrides', () => {
});
});
-describe('applyPlanOverrides — Improve budget from the contract value', () => {
+describe('applyPlanOverrides — the Enterprise AI budget', () => {
const enterprise = {
id: 'enterprise',
name: 'Enterprise',
@@ -57,17 +57,14 @@ describe('applyPlanOverrides — Improve budget from the contract value', () =>
applyPlanOverrides(enterprise, { plan: 'enterprise', plan_overrides }).limits
.improveMonthlyBudgetUsd;
- it('is 1% of the monthly contract', () => {
- expect(budget({ contractMonthlyUsd: 1000 })).toBe(10);
- expect(budget({ contractMonthlyUsd: 2000 })).toBe(20);
- expect(budget({ contractMonthlyUsd: 1234 })).toBe(12.34);
- });
-
- it('never drops below the plan default', () => {
+ it('stays at the plan default whatever the contract is worth (2026-10-27)', () => {
expect(budget({ contractMonthlyUsd: 300 })).toBe(4.99);
+ expect(budget({ contractMonthlyUsd: 1000 })).toBe(4.99);
+ expect(budget({ contractMonthlyUsd: 100000 })).toBe(4.99);
});
- it('an explicit improveMonthlyBudgetUsd wins over the contract value', () => {
+ it('takes the customer’s own budget, set explicitly', () => {
+ expect(budget({ improveMonthlyBudgetUsd: 80 })).toBe(80);
expect(budget({ contractMonthlyUsd: 2000, improveMonthlyBudgetUsd: 7 })).toBe(7);
});
@@ -99,8 +96,8 @@ describe('applyPlanOverrides — relevance allowance from the contract value', (
).toBe(0.5);
});
- it('leaves the Improve budget at its own 1%', () => {
- expect(limits({ contractMonthlyUsd: 1000 }).improveMonthlyBudgetUsd).toBe(10);
+ it('leaves the AI budget at the plan default', () => {
+ expect(limits({ contractMonthlyUsd: 1000 }).improveMonthlyBudgetUsd).toBe(4.99);
});
});
diff --git a/web/messages/en.json b/web/messages/en.json
index 469aa2416..709c31c62 100644
--- a/web/messages/en.json
+++ b/web/messages/en.json
@@ -7761,6 +7761,7 @@
"briefs": "{count, number} content briefs a month",
"audits": "{count, number} site audits a month",
"aiUsage": "{count}x AI usage",
+ "aiUsageCustom": "Custom AI usage, over {count}x",
"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",
diff --git a/web/src/components/settings/plan-switcher.test.tsx b/web/src/components/settings/plan-switcher.test.tsx
index 052e5f3fd..99af0e778 100644
--- a/web/src/components/settings/plan-switcher.test.tsx
+++ b/web/src/components/settings/plan-switcher.test.tsx
@@ -137,6 +137,12 @@ describe('the plan cards', () => {
expect(container.textContent).toContain(
'For large companies and agencies managing AI visibility at scale. Starting at $499/month.',
);
+ // Its AI usage is set per customer, above Enterprise's $50 floor (10x Starter's).
+ const ai = [...container.querySelectorAll('li span')].find(
+ (el) => el.textContent === 'Custom AI usage, over 10x',
+ );
+ expect(ai?.getAttribute('title')).toContain('A monthly allowance for Ansvisor');
+ expect(container.textContent).not.toContain('10x AI usage');
for (const point of [
'Unlimited brands in a custom workspace',
'All answer engines, Claude included',
diff --git a/web/src/components/settings/plan-switcher.tsx b/web/src/components/settings/plan-switcher.tsx
index a842394fa..e7829ef4a 100644
--- a/web/src/components/settings/plan-switcher.tsx
+++ b/web/src/components/settings/plan-switcher.tsx
@@ -174,6 +174,12 @@ export function PlanSwitcher({ subscription, onUpdate }: PlanSwitcherProps) {
}
}
+ /** A plan's AI budget as a multiple of Starter's, as the cards say it; none when unlimited. */
+ function aiMultiple(budget: number): number | null {
+ const starterAi = PLANS.starter.limits.improveMonthlyBudgetUsd;
+ return starterAi > 0 && budget > 0 ? Math.round(budget / starterAi) : null;
+ }
+
/**
* A plan card's list, as the pricing page puts it: brands, seats, prompts,
* the answer engines it tracks, content briefs and site audits a month,
@@ -181,11 +187,7 @@ export function PlanSwitcher({ subscription, onUpdate }: PlanSwitcherProps) {
*/
function planFeatures(planId: PlanId): { text: string; hint?: string }[] {
const { limits } = PLANS[planId];
- const starterAi = PLANS.starter.limits.improveMonthlyBudgetUsd;
- const aiUsage =
- starterAi > 0 && limits.improveMonthlyBudgetUsd > 0
- ? Math.round(limits.improveMonthlyBudgetUsd / starterAi)
- : null;
+ const aiUsage = aiMultiple(limits.improveMonthlyBudgetUsd);
const items = [
limits.maxBrands === -1
? tCards('unlimitedBrands')
@@ -207,6 +209,20 @@ export function PlanSwitcher({ subscription, onUpdate }: PlanSwitcherProps) {
];
}
+ /**
+ * The custom plan's points: its AI usage first, set per customer above
+ * Enterprise's floor (2026-10-27), then the pricing page's points.
+ */
+ function customPlanPoints(): { text: string; hint?: string }[] {
+ const aiUsage = aiMultiple(PLANS.enterprise.limits.improveMonthlyBudgetUsd);
+ return [
+ ...(aiUsage
+ ? [{ text: tCards('aiUsageCustom', { count: aiUsage }), hint: tCards('aiUsageHint') }]
+ : []),
+ ...(t.raw('customPlanPoints') as string[]).map((text) => ({ text })),
+ ];
+ }
+
function isUpgrade(targetPlan: PlanId): boolean {
const order = SUBSCRIBABLE_PLANS;
return order.indexOf(targetPlan) > order.indexOf(currentPlanId);
@@ -489,10 +505,19 @@ export function PlanSwitcher({ subscription, onUpdate }: PlanSwitcherProps) {
</a>
</div>
<ul className="grid gap-x-4 gap-y-1.5 text-xs sm:grid-cols-2">
- {(t.raw('customPlanPoints') as string[]).map((point) => (
- <li key={point} className="flex items-start gap-2">
+ {customPlanPoints().map((point) => (
+ <li key={point.text} className="flex items-start gap-2">
<Check className="mt-0.5 h-3.5 w-3.5 shrink-0 text-emerald-600 dark:text-emerald-400" />
- <span>{point}</span>
+ <span
+ title={point.hint}
+ className={
+ point.hint
+ ? 'cursor-help underline decoration-dotted underline-offset-4'
+ : undefined
+ }
+ >
+ {point.text}
+ </span>
</li>
))}
</ul>
diff --git a/web/src/config/plans.ts b/web/src/config/plans.ts
index 7e267a7f3..01d332faa 100644
--- a/web/src/config/plans.ts
+++ b/web/src/config/plans.ts
@@ -46,8 +46,8 @@ export interface PlanLimits {
/**
* Monthly USD budget for AI usage: Improve-tab model calls (Positions
* 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
+ * writing. Starter $5, Growth $25, Enterprise $50 (or more, set per
+ * customer), 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).
@@ -171,7 +171,7 @@ export const PLANS: Record<PlanId, Plan> = {
maxBriefGenerations: 10,
// 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.
+ // or more, set per customer (2026-10-27); the server gives the free trial $1.
improveMonthlyBudgetUsd: 5,
// 0.1% of the $49 price, spent rating suggestions' relevance (VIS-011).
relevanceMonthlyBudgetUsd: 0.049,
@@ -264,9 +264,9 @@ export const PLANS: Record<PlanId, Plan> = {
maxVolumeAnalyses: -1,
// Per-customer: override via organizations.plan_overrides in the DB.
maxBriefGenerations: -1,
- // 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.
+ // AI usage: $50 at the least, twice Growth's $25. Over that, Ansvisor
+ // sets a customer's own in plan_overrides.improveMonthlyBudgetUsd
+ // (2026-10-27); the contract's value doesn't raise it.
improveMonthlyBudgetUsd: 50,
// 0.1% of the $499 floor, raised to 0.1% of contractMonthlyUsd; an
// explicit plan_overrides.relevanceMonthlyBudgetUsd wins.
diff --git a/web/src/lib/prompt-improve.ts b/web/src/lib/prompt-improve.ts
index 1f4bd9142..84eb87a59 100644
--- a/web/src/lib/prompt-improve.ts
+++ b/web/src/lib/prompt-improve.ts
@@ -72,8 +72,9 @@ export interface ImproveSet {
/**
* The monthly Improve budget as the panel shows it. The budget itself is in
- * dollars (1% of the plan price) and stays on the server; the panel gets an
- * estimate of the generations it still buys.
+ * dollars (the workspace's AI budget: Starter $5, Growth $25, Enterprise $50
+ * or more) and stays on the server; the panel gets an estimate of the
+ * generations it still buys.
*/
export interface ImproveQuota {
unlimited: boolean;