Muetext logo Muetext

Billing and AI budgets

Plans, monthly AI units, top-ups, failed payments and how the owner turns on Stripe.

Plans and AI units

Billing is per workspace. Free includes 200,000 Muetext AI units a month, Pro 2,000,000 and Business 10,000,000, with higher API rate limits on paid plans. Hosted bot replies that use Muetext AI and document indexing spend units from the workspace; replies that use the bot owner's own provider key don't.

An AI top-up adds 1,000,000 units on top of the plan. Units from top-ups are spent after the plan's monthly units and carry over to the next month.

Upgrading and managing

Workspace owners and admins open Settings → Billing and choose Upgrade, Top up AI or Manage billing. Upgrade and Top up go to Stripe Checkout; Manage billing opens the Stripe customer portal to change plan, update the card, see invoices or cancel. Other members can see the plan and the usage meter but can't change them.

The new plan or top-up shows within seconds of a successful payment. The usage meter turns amber at 80% of the month's units and red at 100%, when Muetext AI work pauses until a top-up, an upgrade or the next month.

Failed payments

If a renewal fails, the workspace keeps its plan while Stripe retries the card, and Settings → Billing asks the owner to update it. If Stripe stops retrying, the workspace moves to the Free plan: nothing is deleted, and paying the open invoice restores the plan. Canceling keeps the plan until the end of the paid period.

How it is enforced

Plans and budgets change only after Stripe confirms payment, through a database function the app's users can't call. Every change is written to the audit log. The Stripe webhook at /api/channels/stripe checks the Stripe-Signature header (HMAC-SHA256, five-minute tolerance), records each event id once and skips redeliveries, so retries never double a top-up.

Turning on Stripe (for the Muetext owner)

Billing stays off, and the app shows "Billing isn't set up yet", until all five server settings are present. Use test-mode keys first; live and test events are never mixed.

In Stripe, create two recurring prices (Pro and Business) and one one-time price for the AI top-up, then add a webhook endpoint for https://<your-app>/api/channels/stripe with the events below. Enable plan switching and cancellation in the customer portal settings.

STRIPE_SECRET_KEY=sk_test_...        # or a restricted key rk_test_...
STRIPE_WEBHOOK_SECRET=whsec_...      # from the webhook endpoint
STRIPE_PRICE_PRO=price_...           # recurring, monthly
STRIPE_PRICE_BUSINESS=price_...      # recurring, monthly
STRIPE_PRICE_AI_TOPUP=price_...      # one-time, 1,000,000 units each

# webhook events
checkout.session.completed
checkout.session.async_payment_succeeded
customer.subscription.created
customer.subscription.updated
customer.subscription.deleted
invoice.paid
invoice.payment_failed