Billing, Licenses & Stripe Setup
Complete guide to configuring Stripe for one-time license payments. Covers account creation, API keys, product setup, webhooks, testing, and going live.
License Tiers
AI OS offers four tiers. The Free Demo and Community edition are free. Business and Enterprise licenses use Stripe Checkout for PCI-compliant one-time payment processing.
| Feature | Free Demo ($0) | Community (Free) | Business ($1,997) | Enterprise ($4,997) |
|---|---|---|---|---|
| Hosting | Hosted preview | Self-hosted | Self-hosted | Self-hosted |
| Agent access | 3 agents | 15 agents | All 51 | All 51 |
| Departments | Preview | 5 | All 10 | All 10 |
| Model tiers | Scout only | Scout + Pro | All 7 tiers | All 7 tiers |
| SEO Agency | 1 audit/mo | 5 audits/mo | Unlimited | Unlimited |
| Gemini Omni Studio | ❌ | ❌ | ✅ | ✅ |
| YouTube Intelligence | ❌ | ❌ | ✅ | ✅ |
| Custom agents | ❌ | ❌ | ✅ | ✅ |
| Custom domain | ❌ | ✅ (self-hosted) | ✅ | ✅ |
| SSO / SAML | ❌ | ❌ | ❌ | ✅ |
| Priority support | ❌ | Community | Priority email | Priority + Slack |
| Optional renewal | N/A | N/A | N/A | $997/yr (extend priority support) |
Step 1 — Create a Stripe Account
- Go to dashboard.stripe.com/register
- Sign up with your email
- Verify your email and complete onboarding
Step 2 — Get Your Secret Key
- Go to dashboard.stripe.com/apikeys
- You will see two keys:
- Publishable key (
pk_test_...) — not needed for AI OS - Secret key (
sk_test_...) — click “Reveal test key” and copy it
- Publishable key (
- Paste into your
.env:
STRIPE_SECRET_KEY=sk_test_XXXXXXXXXXXXXXXXXXXXXXXX
Test vs Live: Start with test keys (
sk_test_...). When ready to accept real payments, toggle “Test mode” off in the Stripe dashboard and use live keys (sk_live_...).
Step 3 — Create Products and Prices
Create one Stripe product for each paid license tier. The Free Demo and Community tiers have no Stripe product.
Business License ($1,997 one-time)
- Go to dashboard.stripe.com/products
- Click + Add product
- Fill in:
- Name:
AI OS Business License - Description:
All 51 AI agents, all 10 departments, all commercial modules, self-hosted
- Name:
- Under Price information:
- Pricing model: Standard
- Price: $1,997.00
- One time
- Click Save product
- On the product page, copy the Price ID (starts with
price_) - Paste into
.env:
STRIPE_BUSINESS_PRICE_ID=price_XXXXXXXXXXXXXXXXXXXXXXXX
Enterprise License ($4,997 one-time)
- Click + Add product
- Fill in:
- Name:
AI OS Enterprise License - Description:
Everything in Business + 1 year priority support, custom agents, target response times, self-hosted
- Name:
- Under Price information:
- Pricing model: Standard
- Price: $4,997.00
- One time
- Save, copy the Price ID, paste into
.env:
STRIPE_ENTERPRISE_PRICE_ID=price_XXXXXXXXXXXXXXXXXXXXXXXX
Optional Annual Renewal Products
Optional. If you want to offer an annual renewal to extend priority support, create one additional recurring product: Enterprise Renewal ($997/year). This is optional — licenses work permanently without renewal. Business has no recurring fees.
Step 4 — Set Up the Webhook
The webhook lets Stripe notify your server when payments succeed, annual renewals process, or customers cancel.
- Go to dashboard.stripe.com/webhooks
- Click + Add endpoint
- Endpoint URL:
https://yourdomain.com/api/stripe/webhook - Events to listen to — click “Select events” and add:
checkout.session.completedcustomer.subscription.updatedcustomer.subscription.deletedinvoice.payment_succeededinvoice.payment_failed
- Click Add endpoint
- On the webhook page, click Reveal under “Signing secret” and copy it (
whsec_...) - Paste into
.env:
STRIPE_WEBHOOK_SECRET=whsec_XXXXXXXXXXXXXXXXXXXXXXXX
Important: The webhook endpoint receives raw request bodies (not JSON parsed) because Stripe requires the raw body for signature verification. This is already handled in
server.js — the JSON body parser skips the /api/stripe/webhook route.
Step 5 — Complete .env Configuration
# Stripe — One-time license payments
STRIPE_SECRET_KEY=sk_test_XXXXXXXXXXXXXXXXXXXXXXXX
STRIPE_WEBHOOK_SECRET=whsec_XXXXXXXXXXXXXXXXXXXXXXXX
STRIPE_BUSINESS_PRICE_ID=price_XXXXXXXXXXXXXXXXXXXXXXXX
STRIPE_ENTERPRISE_PRICE_ID=price_XXXXXXXXXXXXXXXXXXXXXXXX
# Optional Enterprise renewal Price ID (if configured)
# STRIPE_ENTERPRISE_RENEWAL_PRICE_ID=price_XXXXXXXXXXXXXXXXXXXXXXXX
Step 6 — Restart and Test
sudo -u aios pm2 restart ai-os --update-env
Stripe Test Cards
| Card Number | Result |
|---|---|
4242 4242 4242 4242 | Successful payment |
4000 0000 0000 3220 | Requires 3D Secure authentication |
4000 0000 0000 0002 | Card declined |
4000 0000 0000 9995 | Insufficient funds |
Use any future expiry date, any 3-digit CVC, and any billing ZIP code.
Step 7 — Go Live
- Complete Stripe account activation (business info, bank account for payouts)
- Toggle Test mode off in the Stripe dashboard
- Copy the live keys (
sk_live_...,whsec_...) - Create the same products/prices in live mode (Price IDs will be different)
- Update your
.envwith all live keys - Update the webhook endpoint to use live mode
- Restart:
sudo -u aios pm2 restart ai-os --update-env
Before going live: Test the full checkout flow end-to-end with test cards. Verify the webhook fires correctly by checking
pm2 logs ai-os for Stripe event handling logs.
Checkout Flow
The license purchase flow uses Stripe Checkout for secure, PCI-compliant payment processing:
- User clicks a pricing CTA on the landing page
- The server creates a Stripe Checkout Session via
GET /api/stripe/checkout?plan=businessor?plan=enterprise - User is redirected to Stripe’s hosted payment page
- After successful one-time payment, Stripe redirects to the success URL
- The server provisions the license, creates a session cookie, and redirects to
/app
Webhook Events
| Event | Action |
|---|---|
checkout.session.completed | Activate license, create session |
customer.subscription.updated | Update annual renewal status (if applicable) |
customer.subscription.deleted | End annual renewal (license remains active) |
invoice.payment_succeeded | Confirm annual renewal payment |
invoice.payment_failed | Notify user of renewal failure |
Session Management
- Cookie name:
ai-os-session - Type: HTTP-only, Secure (production), SameSite: Lax
- Expiry: 30 days
- Content: Cryptographically random token (UUID v4)
- Validation: Server-side lookup maps token → email + plan + role + expiry
- Fallback: Bearer token via
Authorizationheader (for API clients)