Reference
Platform operations (admin)
Super-admin setup: platform AI credentials, transactional email (SMTP), payments, refunds & dunning.
These settings live under the super-admin panel and apply platform-wide (all workspaces share them). You need a platform-admin account.
1. Platform AI credentials
Path: /admin/ai-billing → Platform AI credentials. This is the key that powers every AI feature in platform-hosted mode (auto-reply, RAG retrieval, website/document training, Playground, the config assistant).
- Paste your OpenAI API key (covers chat
gpt-4o-mini+ embeddingstext-embedding-3-small). Anthropic key is optional. - Optional: an OpenAI-compatible
Base URL(Azure / proxy), a default chat model, an embedding model. - Click Save — it takes effect at runtime, no restart needed. Click Test connectivity to confirm the key reaches the provider.
Keys are AES-encrypted in the database and never sent to the browser. Resolution order is DB value first, environment variable as fallback, so you can rotate the key from the panel without editing the server.
2. Transactional email (SMTP / Resend)
Path: /admin/email. Pick SMTP or Resend, fill the credentials, set the From address, then use Send test email to verify. Example (ZeptoMail):
- Host
smtp.zeptomail.com, Port587(STARTTLS) or465(SSL) - User
emailapikey, Password = your provider API key - From = an address on your verified domain
One provider covers every email the product sends:
- Password change codes — Settings → Profile
- Team invites — Settings → Team
- Contact form tickets — the marketing site contact form (reply-to = visitor)
- Dunning emails — sent to the workspace owner when a renewal payment fails
- Test emails — both the tenant (Settings → Email) and admin test buttons
Priority is DB config → environment variables → no-op. If nothing is configured, emails are silently skipped (no crash).
3. Payments, refunds & dunning
Path: /admin/payments.
- Channels: toggle Stripe one-time methods (Alipay / WeChat / crypto), e-pay, USDT. Credit-card is always a recurring subscription.
- Orders: recent orders with status. For pending USDT/e-pay you can auto-check or manually confirm; for paid Stripe orders a Refund button appears.
- Refund: calls Stripe
refunds.create, marks the orderREFUNDED, and reclaims the plan — but only if the workspace has no active recurring subscription (so refunding a one-off won't cancel a card subscriber).
Stripe webhook events (subscribe all 7)
Endpoint https://<your-domain>/api/v1/stripe/webhook must subscribe:
checkout.session.completedcheckout.session.async_payment_succeeded— async WeChat/Alipay via Checkoutpayment_intent.succeeded— Alipay direct; missing it means "paid but plan not activated"customer.subscription.updated/customer.subscription.deletedinvoice.payment_failedcharge.refunded— refunds (panel or Stripe dashboard)
Dunning (renewal failure)
A failed renewal does not suspend immediately. The workspace goes PAST_DUE(plan still usable), a dunning email is sent to the owner, and Stripe's smart retries run. Only when Stripe finally gives up (subscription.deleted) does it downgrade to Free. A successful retry clearsPAST_DUE automatically.