Setting Up the Template
This guide covers the minimum required steps to get the template 100% functional after installation: admin access, default data, AI models (OpenRouter), and billing (Stripe).
Carlos Henrique
Last Update 2 days ago
💬 Want us to set this up for you, for free? If you'd rather not go through the setup yourself, you can open a support ticket or reach out to us directly through the chat in the bottom-right corner of the screen. We'll take care of the configuration for you at no cost.
1. Prerequisites
- A Bubble app created from this template
- A Stripe account (test mode is fine to start)
- An OpenRouter account with an API key (openrouter.ai/workspaces/default/keys)
⚠️ This template was built using Bubble.io’s new editor. Therefore, some features are only available in this version, such as Global Expressions. For more information, see the Property Editor Beta
⚠️ Go to App Editor > Settings > General and enable the "Expose the option to add an ID attribute to HTML elements" option.
2. Turn Off Demo Mode
- In the Bubble editor, go to Data → Option Sets → AppEnvironment
- Open entry v1 and click Modify attributes
- Set Demo mode to no
3. Create Your Admin Account
If your database is empty (you did not copy the sample data when creating the app), there are no users yet — including no admin.
- Go to your app's Sign Up page and create a normal account
- In the Bubble editor, go to Data → App Data → User
- Find the user you just created
- Change its system_role field to Admin
You can now log in and access the Admin panel.
⚠️ Admin:
- email: john-doe@mailto.plus
- pass: 12345678
4. Populate Default Data (Tools & Free Plan)
- Log in as your new admin user
- Go to Admin → System & API → API & Integrations
- Scroll to the "Default Data" section
- If you see "⚠️ No data found", click Populate Default Data
This creates:
- The 6 built-in AI tools (Web Search, Web Fetch, Datetime, Fusion, Advisor, Subagent)
- The Free plan only
⚠️ This button does not create the paid plans (Plus, Pro). You'll create those manually in step 6, since they need to be linked to real Stripe Price IDs specific to your account.
5. Connect OpenRouter
5.1 Get your API key
- Go to openrouter.ai/workspaces/default/keys and create a new key
- Copy it — you'll paste it in the next step
5.2 Add it to your app
- In your app, go to Admin → System & API → API & Integrations
- Under the OpenRouter tab, paste your key into "OpenRouter API Key"
- Click Rotate
5.3 About the AI Chat streaming key
- In the Bubble editor, go to Plugins → API Connector → OpenRouter
- Open the Chat Completion (Stream) call
- In the Authorization header, replace the dynamic parameter with a fixed value: Bearer YOUR_API_KEY
- Check the Private checkbox next to it
- Save
- Go to App Editor > Data > Privacy > AppSetting > "Logged in" rule:
- Uncheck "Find this in searches".
- Uncheck "View" and "Find this in searches" for all fields (key, value, and slug).
⚠️ Once set as Private, rotating your key means updating it in two places: the admin panel (used by all other calls) and this Private field (used only by streaming).
⚠️ Before going live: the API Connector lets you set different values for the Test and Live versions of your app. Make sure you enter your OpenRouter key for the live version as well — not just the test/development one — or streaming will fail once your app is published.
5.4 Import your AI models
- Go to Admin → Models → Import
- Click Import and confirm
- Models are pulled directly from OpenRouter and cached in your database
- Toggle Available on/off per model to control what your users can select
⚠️ Before enabling a model for your users: check its supported_parameters on openrouter.ai/models — if it doesn't support tools, your AI Chat will fail with a 404 error whenever any tool (Web Search, Advisor, etc.) is enabled alongside it. Also confirm input_modalities includes image/file if you plan to allow attachments, and check context_length against your Chat Memory setting to avoid context-overflow errors.
⚠️ ZDR (Zero Data Retention) Support: if the user enables the ZDR toggle, make sure that the selected model/provider supports a ZDR-compatible endpoint. Otherwise, the request will fail. Not every model/provider supports ZDR.
⚠️ Re-run the import periodically to keep your model catalog up to date with new OpenRouter releases.
6. Connect Stripe
6.1 Add your Stripe keys to the plugin
- In the Bubble editor, go to Plugins → Stripe
- Enter your Publishable Key and Secret Key (start with test keys)
- You can find both keys in the Stripe Dashboard, under the API keys section: Stripe Dashboard → Developers → API keys
- Publishable key → starts with pk_test_ or pk_live_
- Secret key → starts with sk_test_ or sk_live_
| Environment | Publishable | Secret |
|---|---|---|
| Test | pk_test_... | sk_test_... |
| Live | pk_live_... | sk_live_... |
6.2 Set Checkout Version to v3
- In the same Plugins → Stripe settings screen, find Checkout Version
- Set it to v3 (Recommended)
6.3 Add your Stripe Secret Key to the API Connector
The Customer Portal ("Manage billing") uses a direct API call configured separately from the Stripe plugin, since the native plugin doesn't support it.
- In the Bubble editor, go to Plugins → API Connector → Stripe
- Paste your Stripe Secret Key into the Authorization header (same key as step 6.1)
- Open the Stripe Billing Portal call
⚠️ In the Headers section of the Stripe Billing Portal and Update Subscription calls for Stripe in the API Connector plugin, if it doesn't already exist, add the following header:
- Key: Content-Type
- Value: application/x-www-form-urlencoded
6.4 Create your Products & Prices in Stripe
- Go to Stripe Dashboard → Product catalog → Add product
- Set the name, price, and billing interval
- Copy the generated Price ID (starts with price_...)
- Go to Admin → Management → Plans
- Click Create Plan for each paid plan (Plus Monthly, Plus Yearly, Pro Monthly, Pro Yearly)
- Fill in the name, price, interval, seat limit, token limit, features, and the matching Stripe Price ID
6.6 Check your Stripe API version
- Go to Stripe Dashboard → Developers → Overview → API Versions
- Compare your account's default version to 2026-07-29.dahlia
- If it's older, click Upgrade version and select the matching (or newer) version
6.7 Set up Webhooks
Webhooks keep your app in sync with Stripe (cancellations, renewals, failed payments).
Finding your workflow URLs:
- In the Bubble editor, go to Settings → API
- Copy the Workflow API root URL shown there — it looks like:
3. Append the backend workflow name to the end of that URL. For example:
| Workflow name | Stripe event |
|---|---|
| stripe_webhook_subscription_created | customer.subscription.created |
| stripe_webhook_subscription_updated | customer.subscription.updated |
| stripe_webhook_subscription_deleted | customer.subscription.deleted |
| stripe_webhook_invoice_paid | invoice.paid |
| stripe_webhook_invoice_payment_failed | invoice.payment_failed |
⚠️ Before going live, repeat this step using your version-live URL instead of version-test, and configure a second set of webhooks in Stripe pointing to your live app.
7. Start the Recurring "Free Period Reset" Event
- Log in as admin
- Go to Admin → System & API → API & Integrations
- Click Initialize Free Period (or the equivalent button in that section)
8. Test the Full Flow
- Sign up as a new user, create a workspace
- Open AI Chat, send a message, confirm a streamed response appears
- Enable a tool (e.g. Web Search) and confirm it affects the response
- Go to Billing, subscribe to a paid plan using a Stripe test card (4242 4242 4242 4242)
- Confirm the plan updates in your app after checkout
- Cancel the subscription and confirm it reverts to Free
- Log in as admin, confirm the Dashboard shows MRR/Revenue data
9. Going to Production — Checklist
Before switching your app to the live version, make sure you've done all of the following:
- Added your OpenRouter key for the live version (step 5.3)
- Added your Stripe live keys to the Stripe plugin (step 6.1) and the Billing Portal API Connector call (step 6.3)
- Set up live-mode webhooks in Stripe, pointing to your version-live URLs (step 6.7)
- Copied your database from version-test to version-live — at minimum, the Tool and Plan tables, and any other data you want carried over (Bubble's Deploy to live screen lets you choose which tables to copy)
- Turned off Demo Mode on the live version too, if it was re-enabled during deployment
Troubleshooting
Some Stripe accounts default new subscriptions to "Flexible" billing mode, which can be incompatible with Bubble's native Stripe actions. If you run into this error, try setting Billing mode → Classic in Stripe Dashboard → Settings → Billing → Subscriptions and emails. This isn't required for every account — only apply this fix if you actually encounter the error.
Confirm the key entered in Admin → API & Integrations (step 5.2) is valid. If you've already made the streaming key Private (step 5.3), check that field directly in the API Connector instead — and confirm it's set for the environment (test/live) you're currently using.
This is intentional for the marketplace demo only — see step 5.3 for the full explanation and the steps to lock it down for your own production app.
Run the model import again (step 5.4). Confirm your OpenRouter API key is valid via Test Key (step 5.2).
Double-check the event type selected in Stripe matches the workflow name, and that the webhook URL points to the correct environment (version-test vs. version-live).
Demo Mode is probably still enabled — see step 3.
