Multi-plan subscriptions: Founders, Standard/Pro/Business (future), Backer whitelist, quota + feature gating #36

Open
opened 2026-07-31 04:01:26 -07:00 by westfarn · 1 comment
Owner

Today billing is a single $10/mo subscription (SUBSCRIPTION_PRICE_* / optional STRIPE_PRICE_ID). This ticket expands that into a plan catalog with visibility rules, a Backer whitelist path, and quota + feature gating.

Coordinates with:

  • #16 — token usage display in chat UI (surface plan/quota status alongside tokens where useful)
  • #17 — token-based billing / quotas / enforcement (period aggregation + warn/block). This ticket owns plan definitions, feature flags, and prompt-window rate limits; #17 owns token usage rollups and token-period enforcement. Implement so both share one plan → limits model.

Summary

Define multiple subscription plans (Founders live now; Standard / Pro / Business seeded but hidden; Backer invite-only), then gate features (text vs image) and prompt quotas (rolling 6-hour windows) by plan.

Plan catalog

Plan Price Selectable / shown in UI Features Prompt quota (per 6h window)
Founders $10 / mo Yes (current public plan) Text + all future capabilities as they ship (incl. image gen) 300
Standard $15 / mo No (seed for future) Text generation only 100
Pro / Creator $40 / mo No (seed for future) Text + image generation 200
Business Team $99 / mo No (seed for future) Text + image generation; multi-seat / team auth / priority support (future) 300
Backer $0 No (not selectable) Same as Founders (text + all future, incl. image) 300

Founders

  • Replaces / formalizes the current $10/mo product.
  • Unlimited product access relative to what we ship: no feature lockouts for Founders as new capabilities land.
  • Still subject to the 300 prompts / 6h rate limit (abuse protection), not a soft “unlimited prompts” free-for-all.

Standard / Pro / Business (future, not shown now)

  • Persist plans + Stripe Price IDs (or price_data) in DB/config so Checkout can switch later without another schema redesign.
  • Checkout / pricing page must not list these until explicitly enabled (feature flag or is_public on plan).
  • Suggested marketing copy (for when they go live):
    • Standard ($15): developers & privacy-conscious individuals — secure chat, coding assistance, standard rate limits.
    • Pro / Creator ($40): heavy / multi-modal users — higher caps, image workflows, faster processing.
    • Business Team ($99): local companies / sensitive data — seats, centralized team auth, priority support, absolute data privacy.

Backer (invite / email whitelist)

  • Not shown and not selectable at checkout.
  • Admin (or ops) can pre-register email addresses on the Backer tier.
  • On registration / first login: if email is on the Backer list → assign Backer plan, no payment, Founders-level feature access + 300/6h quota.
  • Document conflict rules (e.g. Backer email who later tries to buy Founders; removing from whitelist).

Feature gating

We only have text generation today; image generation is forthcoming.

Capability Standard Pro Business Founders Backer
Text generation
Image generation (when available)
Future capabilities as they ship per-plan per-plan per-plan ✓ all ✓ all
  • Centralize checks (e.g. user.plan.allows("image_generation")) used by API / chat consumers.
  • Denied features return a clear, plan-aware error (not a generic 500).

Quota gating (prompt rate limits)

Rolling 6-hour window, counted as prompts (chat turns), not tokens:

Plan Prompts / 6h
Standard 100
Pro / Creator 200
Business Team 300
Founders 300
Backer 300
  • Enforce in the chat / generation path (before or at start of a turn).
  • Near-limit warning + hard block when exceeded; surface remaining quota to clients where useful.
  • Distinct from #17’s token / billing-period quotas — both may apply; document precedence (e.g. either limit can block).

Requirements

  1. Plan model (or equivalent): slug, display name, price, Stripe price id, is_public / is_selectable, feature flags, prompt quota + window length, sort order.
  2. Seed data: Founders (public, $10), Standard/Pro/Business (private, $15/$40/$99), Backer (private, $0).
  3. Checkout: only public/selectable plans; migrate current single-price flow to Founders.
  4. Backer whitelist: admin CRUD for emails; auto-assign on register; skip Stripe for those users.
  5. Feature gating middleware/service for text vs image (and extensible for future flags).
  6. Quota gating: 6h rolling prompt counters per user (and note company/seat implications for Business later).
  7. Admin: view/edit user plan, whitelist emails, inspect remaining quota.
  8. Tests: plan seeding, visibility, Backer assign-on-register, feature deny/allow, quota warn/block, Founders checkout still works.
  9. Cross-ticket: share plan→limits with #17; expose enough for #16 UI (plan name, remaining prompts, token totals).

Acceptance criteria

  • Plan catalog exists with Founders ($10, public), Standard ($15), Pro ($40), Business ($99), Backer ($0)
  • Standard / Pro / Business / Backer are not shown or selectable in checkout/UI by default
  • Current $10 subscription path maps to Founders
  • Backer emails can be pre-added; matching registrants get Founders-level access with no charge
  • Feature gating: Standard = text only; Pro / Business / Founders / Backer = text + image (when image ships)
  • Quota gating: 100 / 200 / 300 / 300 / 300 prompts per 6h for Standard / Pro / Business / Founders / Backer
  • Enforcement wired into generation path (clear errors + optional remaining quota in API)
  • Coordination notes / shared model with #16 and #17 documented in PR
  • Tests cover catalog visibility, Backer whitelist, feature gates, and quota enforcement

Out of scope (follow-ups)

  • Enabling Standard / Pro / Business in public checkout (flip is_public + marketing).
  • Full Business multi-seat / SSO / priority-support productization (plan row + gates only for now).
  • Token-period billing math and admin usage-vs-quota dashboards — owned by #17.
  • Chat web app token display polish — owned by #16 (may consume plan/quota fields from this work).

Notes

  • Prefer one source of truth for “what does this user get?” so #16 UI and #17 token enforcement do not fork plan logic.
  • Null/missing provider token usage (#16 / #17) must not confuse prompt quota counting — prompt quota increments per accepted turn regardless of provider token reporting.
Today billing is a single $10/mo subscription (`SUBSCRIPTION_PRICE_*` / optional `STRIPE_PRICE_ID`). This ticket expands that into a plan catalog with visibility rules, a Backer whitelist path, and **quota + feature gating**. Coordinates with: - #16 — token usage display in chat UI (surface plan/quota status alongside tokens where useful) - #17 — token-based billing / quotas / enforcement (period aggregation + warn/block). This ticket owns **plan definitions**, **feature flags**, and **prompt-window rate limits**; #17 owns **token usage rollups and token-period enforcement**. Implement so both share one plan → limits model. ## Summary Define multiple subscription plans (Founders live now; Standard / Pro / Business seeded but hidden; Backer invite-only), then gate **features** (text vs image) and **prompt quotas** (rolling 6-hour windows) by plan. ## Plan catalog | Plan | Price | Selectable / shown in UI | Features | Prompt quota (per 6h window) | |------|-------|--------------------------|----------|------------------------------| | **Founders** | $10 / mo | Yes (current public plan) | Text + all future capabilities as they ship (incl. image gen) | **300** | | **Standard** | $15 / mo | **No** (seed for future) | Text generation only | **100** | | **Pro / Creator** | $40 / mo | **No** (seed for future) | Text + image generation | **200** | | **Business Team** | $99 / mo | **No** (seed for future) | Text + image generation; multi-seat / team auth / priority support (future) | **300** | | **Backer** | $0 | **No** (not selectable) | Same as Founders (text + all future, incl. image) | **300** | ### Founders - Replaces / formalizes the current $10/mo product. - Unlimited *product* access relative to what we ship: no feature lockouts for Founders as new capabilities land. - Still subject to the **300 prompts / 6h** rate limit (abuse protection), not a soft “unlimited prompts” free-for-all. ### Standard / Pro / Business (future, not shown now) - Persist plans + Stripe Price IDs (or price_data) in DB/config so Checkout can switch later without another schema redesign. - Checkout / pricing page must **not** list these until explicitly enabled (feature flag or `is_public` on plan). - Suggested marketing copy (for when they go live): - **Standard** ($15): developers & privacy-conscious individuals — secure chat, coding assistance, standard rate limits. - **Pro / Creator** ($40): heavy / multi-modal users — higher caps, image workflows, faster processing. - **Business Team** ($99): local companies / sensitive data — seats, centralized team auth, priority support, absolute data privacy. ### Backer (invite / email whitelist) - Not shown and not selectable at checkout. - Admin (or ops) can **pre-register email addresses** on the Backer tier. - On registration / first login: if email is on the Backer list → assign Backer plan, **no payment**, Founders-level feature access + 300/6h quota. - Document conflict rules (e.g. Backer email who later tries to buy Founders; removing from whitelist). ## Feature gating We only have **text generation** today; **image generation** is forthcoming. | Capability | Standard | Pro | Business | Founders | Backer | |------------|----------|-----|----------|----------|--------| | Text generation | ✓ | ✓ | ✓ | ✓ | ✓ | | Image generation (when available) | ✗ | ✓ | ✓ | ✓ | ✓ | | Future capabilities as they ship | per-plan | per-plan | per-plan | ✓ all | ✓ all | - Centralize checks (e.g. `user.plan.allows("image_generation")`) used by API / chat consumers. - Denied features return a clear, plan-aware error (not a generic 500). ## Quota gating (prompt rate limits) Rolling **6-hour window**, counted as **prompts** (chat turns), not tokens: | Plan | Prompts / 6h | |------|--------------| | Standard | 100 | | Pro / Creator | 200 | | Business Team | 300 | | Founders | 300 | | Backer | 300 | - Enforce in the chat / generation path (before or at start of a turn). - Near-limit warning + hard block when exceeded; surface remaining quota to clients where useful. - Distinct from #17’s **token / billing-period** quotas — both may apply; document precedence (e.g. either limit can block). ## Requirements 1. **Plan model** (or equivalent): slug, display name, price, Stripe price id, `is_public` / `is_selectable`, feature flags, prompt quota + window length, sort order. 2. **Seed data**: Founders (public, $10), Standard/Pro/Business (private, $15/$40/$99), Backer (private, $0). 3. **Checkout**: only public/selectable plans; migrate current single-price flow to Founders. 4. **Backer whitelist**: admin CRUD for emails; auto-assign on register; skip Stripe for those users. 5. **Feature gating** middleware/service for text vs image (and extensible for future flags). 6. **Quota gating**: 6h rolling prompt counters per user (and note company/seat implications for Business later). 7. **Admin**: view/edit user plan, whitelist emails, inspect remaining quota. 8. **Tests**: plan seeding, visibility, Backer assign-on-register, feature deny/allow, quota warn/block, Founders checkout still works. 9. **Cross-ticket**: share plan→limits with #17; expose enough for #16 UI (plan name, remaining prompts, token totals). ## Acceptance criteria - [ ] Plan catalog exists with Founders ($10, public), Standard ($15), Pro ($40), Business ($99), Backer ($0) - [ ] Standard / Pro / Business / Backer are **not** shown or selectable in checkout/UI by default - [ ] Current $10 subscription path maps to **Founders** - [ ] Backer emails can be pre-added; matching registrants get Founders-level access with **no charge** - [ ] Feature gating: Standard = text only; Pro / Business / Founders / Backer = text + image (when image ships) - [ ] Quota gating: 100 / 200 / 300 / 300 / 300 prompts per 6h for Standard / Pro / Business / Founders / Backer - [ ] Enforcement wired into generation path (clear errors + optional remaining quota in API) - [ ] Coordination notes / shared model with #16 and #17 documented in PR - [ ] Tests cover catalog visibility, Backer whitelist, feature gates, and quota enforcement ## Out of scope (follow-ups) - Enabling Standard / Pro / Business in public checkout (flip `is_public` + marketing). - Full Business multi-seat / SSO / priority-support productization (plan row + gates only for now). - Token-period billing math and admin usage-vs-quota dashboards — owned by #17. - Chat web app token display polish — owned by #16 (may consume plan/quota fields from this work). ## Notes - Prefer one source of truth for “what does this user get?” so #16 UI and #17 token enforcement do not fork plan logic. - Null/missing provider token usage (#16 / #17) must not confuse **prompt** quota counting — prompt quota increments per accepted turn regardless of provider token reporting.
westfarn self-assigned this 2026-07-31 04:01:26 -07:00
Author
Owner

Implemented in PR #37 (plan catalog, Backer whitelist, feature + prompt gates) with FE ai_ml_operations/chat_web_app#72.

Implemented in PR https://git.aimloperations.com/ai_ml_operations/chat_backend/pulls/37 (plan catalog, Backer whitelist, feature + prompt gates) with FE https://git.aimloperations.com/ai_ml_operations/chat_web_app/pulls/72.
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ai_ml_operations/chat_backend#36