MCP & API Builders

How to Build an AI App Builder in 2026: Your Own Lovable or Bolt Clone with Next.js

Totalum Team10 min read

Want your own Lovable or Bolt.new, under your brand and on your domain? This tutorial shows how to build an AI app builder in 2026 with the open-source ai-app-builder-open starter (MIT, Next.js) and one Totalum API key: clone it, add the key, run it, generate a full-stack app from a prompt, deploy it, and then turn it into a product with your own login, payments and pricing. It also compares the other ways to build a Lovable or Bolt clone, with data read on November 14, 2026.

Updated November 2026. Re-checked against the repository on November 14, 2026 (99 stars, 53 forks, last commit November 6, 2026), with the current architecture (server proxy routes, the ownership checks to add before real users), a comparison of build paths and what running your builder costs, based on our own test builds.

Diagram of how to build an AI app builder: one API key powering hosting, database, auth, AI, and deployment into a live web app

The short answer: to build your own AI app builder, clone ai-app-builder-open (MIT, Next.js 16), add a Totalum API key (TOTALUM_VCAAS_API_KEY), run npm install and npm run dev, and deploy to Vercel or any Node host. The alternatives are the v0 API (token-priced, deploys to Vercel), the Lovable API + MCP (Business plan), or open-source projects like bolt.diy and open-lovable where you bring your own model keys and backend.

Building this for your customers? See the Totalum white-label builder and the API documentation. The API works on every plan, including Free.

Quick Answer

  • Steps: get a Totalum API key, clone the repo, npm install, put the key in .env.local, npm run dev, prompt an app, deploy.
  • What the key gives you: the AI agent that writes each app, hosting, a sandbox per project, an SQL database per app (development and live), sign-in for the generated apps, custom domains and GitHub sync.
  • What the starter gives you: the product on top: prompt box, live preview, a visual editor, a code editor, a database browser, logs, version history and deploy buttons.
  • What you add before real users: your own login and ownership checks (the repo marks the exact file), and payments if you sell it.
  • What it costs to run: credits on your Totalum account (from $0.07 each). In our November 2026 tests, a first app version took 26 to 37 credits.

Ways to build a Lovable or Bolt clone in 2026

Read on each project's GitHub page or pricing page between November 10 and 14, 2026.

Path What you get What you still build or bring Cost model
ai-app-builder-open + Totalum API A complete builder UI (MIT, Next.js 16, 99 stars, last commit Nov 6, 2026); every generated app is a full-stack Next.js project with its own database, sign-in and hosting Your login, ownership checks and payments if you sell it Totalum credits from $0.07; API on every plan, including Free
v0 API (Vercel) Chats that generate and iterate on apps, previews, deploys to Vercel Your UI, user accounts, billing; database and sign-in for generated apps via services you connect Tokens: v0 Mini $0.20 / $1.20 per million in/out; v0 plan from $30 per user
Lovable API + MCP REST API to manage and deploy projects; app creation and editing through the Lovable MCP server Your UI and accounts; projects live in a Lovable workspace API keys need Business ($50/month) or Enterprise; Lovable credits
bolt.diy Open-source Bolt-style builder (MIT, about 20,100 stars, last push Oct 14, 2026) Model API keys, hosting, databases and auth for generated apps Free code; you pay your model and hosting providers
open-lovable Open-source app that recreates websites with AI (MIT, about 28,900 stars, last push Oct 9, 2026) Model and scraping keys; the backend for real apps Free code; you pay the providers it calls
Build from scratch Whatever you design: model, sandbox, deploy pipeline, databases Everything Model tokens plus sandboxes (for example E2B Pro $150/month plus usage) plus hosting

The decision is about the hard part. Open-source front ends are free, but the generated apps still need a database, sign-in, hosting and a safe place to run. With the Totalum path, those come with each generated project, so the starter only has to be the interface.

What you are building

ai-app-builder-open is Totalum's open-source reference app builder. The repository describes its job clearly: the Totalum API does the hard part (the agent that writes the code and the hosting of every generated app), and the repo is the product on top.

Out of the box it includes:

  • Prompt to full-stack app, with a live preview that updates while the agent works.
  • Visual editor: click an element in the preview and change its text, size, colours or image; the change is written back to the source.
  • Code editor (Monaco, the VS Code editor) for every generated file.
  • Database browser: each app has its own SQL database with a development and a live copy; browse rows, run SQL or ask in plain words.
  • Secrets per project and environment, logs, version history with a diff viewer, export, import and duplicate projects.
  • Custom domains (connect one you own, or buy one from the app), GitHub sync in both directions, and Figma links as input.
  • Isolated sandboxes per project and one project per user or customer, so it is multi-tenant by design.

The builder UI itself is deliberately lean: it ships no login, payments or AI SDK of its own. The generated apps get those from Totalum; your builder gets them when you productize it (Step 8).

Before you start

  • Node.js 20 or newer and npm.
  • Git and a terminal.
  • A Totalum account (the free plan is enough to start; the first 50 credits are free).

How to build an AI app builder in 8 steps

Step 1: Get your Totalum API key

Create an account at totalum.app, choose "Use the Totalum API" during onboarding and copy the key (it starts with tlm_sk_). Keep it private: it is an account key, and everything your builder does is billed to that account. The API overview and the quickstart show your first calls.

Step 2: Clone the repository

git clone https://github.com/totalumlabs/ai-app-builder-open.git
cd ai-app-builder-open

If you plan to build a product on it, fork it first and clone your fork.

Step 3: Install the dependencies

npm install

Step 4: Add your API key

cp .env.example .env.local

Open .env.local and set the only required variable:

TOTALUM_VCAAS_API_KEY=your_key_here

Two optional variables exist: NEXT_PUBLIC_APP_URL (your public URL, used to allow-list the origin in production) and TOTALUM_API_URL (only to point at another Totalum environment).

Step 5: Run it locally

npm run dev

Open http://localhost:3000: you get the prompt box, preview, code view and database panels.

Step 6: Generate your first app

Type a concrete prompt, for example "a booking app for a hair salon with services, time slots and a customer list". The browser calls same-origin routes under /api/vcaas/*; the server adds your key and forwards the call to Totalum, which creates a project, runs the agent and returns a live preview. Every Totalum call goes through one client file (src/lib/vcaas.ts); the part that holds the key is src/lib/vcaas-server.ts, so the key never reaches the browser.

How long and how much: in our November 11, 2026 tests through the same API, a first working version of seven typical apps (a CRM, a client portal, a booking app, a dashboard, a directory and others) took 13 to 17 minutes and 26 to 37 credits each, and one follow-up change took 4 to 9 minutes and 36 to 46 credits.

Step 7: Deploy your builder

  • Vercel: use the "Deploy with Vercel" button in the README and set TOTALUM_VCAAS_API_KEY in the project settings.
  • Any Node host (a VM, Docker, Railway, Render, Fly.io):
npm run build
npm start

It serves on $PORT (default 3000). Set the key in the host environment.

Step 8: Turn it into a product

Before strangers use it, do three things the repository itself calls out:

  1. Add ownership checks. The app runs on one API key, so by default every request is allowed to touch every project. The file src/app/api/vcaas/_shared.ts is where you answer "who is asking?" and "may they touch this project?"; the API routes already delegate to it.
  2. Add login and payments. Pick an auth provider (for example Supabase Auth, Better Auth or Clerk) and a payments provider (for example Stripe) for your own users. The repo's AGENTS.md describes a pattern: a profiles table with a credits balance, a webhook that tops it up after checkout, and a "payment required" answer when the balance is empty.
  3. Remove the operator billing message. When your Totalum account runs out of credits, the starter tells the person using it and links to Totalum billing. That message is for you, not your customers.

Then set limits per customer on the Totalum side: one project per customer, monthly credit caps per project, and a webhook when a project reaches its cap. Our guide to the AI app builder API shows those calls.

Planning to sell it? The white-label builder page covers reselling app building under your brand, or book a 30-minute call for an integration review.

What running your own AI app builder costs

Cost line With ai-app-builder-open + Totalum
The starter code Free (MIT)
Hosting your builder Your choice: Vercel, a VM or any Node host
Building apps Totalum credits from $0.07 each; in our tests a first version took 26 to 37 credits and a follow-up 36 to 46
Running the generated apps Infrastructure (hosting, database, AI, email) billed in credits per project, with monthly caps you set
Custom domains for generated apps Via the API on any paid plan

Price your product above your credit cost per customer, and cap each customer's project so one heavy user cannot run up your bill.

Common mistakes

  • Calling the Totalum API from the browser. Keep every call behind the server proxy.
  • Skipping the ownership checks. Without them, any signed-in user could reach any project.
  • One project for all customers. Use one project per customer so data, secrets and domains stay separate.
  • No spending caps. Set monthly caps per project from day one.

Why build on Totalum

  • The hard part is done: each generated app is a full-stack Next.js project with its own SQL database, sign-in, file storage and hosting.
  • A real starter, not a demo: MIT-licensed, actively maintained, with a visual editor, code editor, database browser and version history.
  • Built for reselling: every project belongs to your account and brand; your users never need a Totalum account.
  • Cost controls in the API: per-project credit caps, spend analytics and webhooks.
  • API and MCP on every plan, including Free.

FAQ

How do you build an AI app builder without a big engineering team?

Use a builder API for the hard part and an open-source starter for the interface. With ai-app-builder-open and a Totalum key you have a working builder in an afternoon; making it a product (login, payments, pricing) is the remaining work.

How do I build a Lovable clone?

Clone ai-app-builder-open, add a Totalum API key and run it: you get a Lovable-style prompt box, live preview, code and visual editors, and every generated app comes with a database, sign-in and hosting. Open-source alternatives such as bolt.diy and open-lovable give you the interface but leave the generated apps' backend and hosting to you.

Is there an open-source Bolt or Lovable clone?

Yes: ai-app-builder-open (MIT, runs on the Totalum API), bolt.diy (MIT) and open-lovable (MIT). Check what each one expects you to provide: model keys, hosting, databases and sign-in for the apps it builds.

Is the starter free?

The code is free under the MIT license. Running it uses credits on your Totalum account; the first 50 credits are free and paid plans start at $29 a month.

Do I need one API key per user?

No. Your builder uses one key on the server. You create one Totalum project per customer and enforce who can access which project in your own code.

Where does the data of generated apps live?

Each generated app has its own SQL database managed by Totalum, with a development and a live copy and an admin view; any minute of the last 30 days can be restored.

Start building your AI app builder

Clone the repository, get a key from the API docs and have a working builder running locally today. When you are ready to sell it, see the white-label builder. If you only want to build your own app rather than a builder, start building free on Totalum.

Totalum Team

Writes for the Totalum blog about AI app building, no-code development, and product engineering.

Related posts

Start building with Totalum

Create your web app with AI in minutes. No code needed.

Start building free