Docs / Billing & Stripe Setup

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.

FeatureFree Demo ($0)Community (Free)Business ($1,997)Enterprise ($4,997)
HostingHosted previewSelf-hostedSelf-hostedSelf-hosted
Agent access3 agents15 agentsAll 51All 51
DepartmentsPreview5All 10All 10
Model tiersScout onlyScout + ProAll 7 tiersAll 7 tiers
SEO Agency1 audit/mo5 audits/moUnlimitedUnlimited
Gemini Omni Studio
YouTube Intelligence
Custom agents
Custom domain✅ (self-hosted)
SSO / SAML
Priority supportCommunityPriority emailPriority + Slack
Optional renewalN/AN/AN/A$997/yr (extend priority support)

Step 1 — Create a Stripe Account

  1. Go to dashboard.stripe.com/register
  2. Sign up with your email
  3. Verify your email and complete onboarding

Step 2 — Get Your Secret Key

  1. Go to dashboard.stripe.com/apikeys
  2. 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
  3. 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)

  1. Go to dashboard.stripe.com/products
  2. Click + Add product
  3. Fill in:
    • Name: AI OS Business License
    • Description: All 51 AI agents, all 10 departments, all commercial modules, self-hosted
  4. Under Price information:
    • Pricing model: Standard
    • Price: $1,997.00
    • One time
  5. Click Save product
  6. On the product page, copy the Price ID (starts with price_)
  7. Paste into .env:
STRIPE_BUSINESS_PRICE_ID=price_XXXXXXXXXXXXXXXXXXXXXXXX

Enterprise License ($4,997 one-time)

  1. Click + Add product
  2. Fill in:
    • Name: AI OS Enterprise License
    • Description: Everything in Business + 1 year priority support, custom agents, target response times, self-hosted
  3. Under Price information:
    • Pricing model: Standard
    • Price: $4,997.00
    • One time
  4. 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.

  1. Go to dashboard.stripe.com/webhooks
  2. Click + Add endpoint
  3. Endpoint URL: https://yourdomain.com/api/stripe/webhook
  4. Events to listen to — click “Select events” and add:
    • checkout.session.completed
    • customer.subscription.updated
    • customer.subscription.deleted
    • invoice.payment_succeeded
    • invoice.payment_failed
  5. Click Add endpoint
  6. On the webhook page, click Reveal under “Signing secret” and copy it (whsec_...)
  7. 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 NumberResult
4242 4242 4242 4242Successful payment
4000 0000 0000 3220Requires 3D Secure authentication
4000 0000 0000 0002Card declined
4000 0000 0000 9995Insufficient funds

Use any future expiry date, any 3-digit CVC, and any billing ZIP code.

Step 7 — Go Live

  1. Complete Stripe account activation (business info, bank account for payouts)
  2. Toggle Test mode off in the Stripe dashboard
  3. Copy the live keys (sk_live_..., whsec_...)
  4. Create the same products/prices in live mode (Price IDs will be different)
  5. Update your .env with all live keys
  6. Update the webhook endpoint to use live mode
  7. 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:

  1. User clicks a pricing CTA on the landing page
  2. The server creates a Stripe Checkout Session via GET /api/stripe/checkout?plan=business or ?plan=enterprise
  3. User is redirected to Stripe’s hosted payment page
  4. After successful one-time payment, Stripe redirects to the success URL
  5. The server provisions the license, creates a session cookie, and redirects to /app

Webhook Events

EventAction
checkout.session.completedActivate license, create session
customer.subscription.updatedUpdate annual renewal status (if applicable)
customer.subscription.deletedEnd annual renewal (license remains active)
invoice.payment_succeededConfirm annual renewal payment
invoice.payment_failedNotify 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 Authorization header (for API clients)