To build an AI SaaS, solve one narrow problem people already pay to solve, ship one AI feature that does it reliably, and build only what a paying customer needs, in this order: validation, the AI route, sign-in with Row Level Security, Stripe checkout, usage limits, then launch. A common 2026 stack is Next.js on Vercel, Supabase, the AI SDK, an OpenAI or Anthropic model and Stripe. Price from measured token cost per task, because the model you pick decides which prices can work.
How to build an AI SaaS in 2026: pick one painful task for one kind of customer, prove they will pay, then build in the order that reaches a first paying user fastest: the AI route, sign-in, checkout, usage limits, launch. A common stack is Next.js on Vercel, Supabase, the AI SDK, an OpenAI or Anthropic model and Stripe, and the plan you can charge for depends on the token cost of each task.
Prices and limits checked October 2026 on Vercel Pro, Vercel fair use, Vercel function duration, Supabase pricing, Stripe pricing, Stripe Managed Payments pricing, OpenAI API pricing, Anthropic API pricing and the Next.js September 2026 security release. This update replaces the April 2026 version, whose revenue figures for named companies and several prices could not be verified.
The costs side of this guide connects to our LLM API pricing comparison, the hub for model prices across OpenAI, Anthropic and Gemini. This page is the build side: what to build first, what to leave out, and how to run the numbers before a customer finds the plan that loses you money.
What does an AI SaaS actually need?
Strip away the hype and a first version has six parts, and they connect in one line:
- 01Signed-in user
Supabase Auth; each customer sees only their own rows.
- 02Server route
A Next.js Route Handler checks the plan and remaining quota.
- 03Model call
OpenAI or Anthropic, with capped output tokens.
- 04Validate and record
Check the output format; save token usage against the user.
- 05Bill
Stripe checkout and webhooks set the plan and its limits.
- One job it does well for a specific kind of customer, such as turning sales-call transcripts into CRM notes for small agencies.
- One AI feature that does that job, with prompts and output formats tested on real examples.
- Accounts, so each customer's data and history stay private.
- Usage limits per plan, because every request has a token cost.
- Billing, including tax and receipts.
- Cost and quality tracking: tokens per customer, and a test set you re-run whenever you change a prompt or model.
Team seats, dashboards, integrations and settings pages can all wait until a customer asks for them.
How do you build an AI SaaS product step by step?
Most first-time founders build in the order a tutorial teaches: landing page, auth, database, dashboard, then the AI feature, then billing. That order delays the two things that decide whether you have a business: whether the AI output is good enough, and whether anyone pays. Reverse it. This is a suggested six-week plan for one person working part time; stretch or shrink the weeks, but keep the order.
- Week 1Validate and pre-sell
Interview people with the problem, run the job by hand for a few, ask for a paid pilot or pre-order.
- Week 2The AI route and a test set
One server route, one prompt, 20 to 50 real examples with known good answers.
- Week 3Sign-in and RLS
Supabase Auth, tables for users, jobs and outputs, Row Level Security on every table.
- Week 4Checkout and webhooks
Stripe Checkout, a webhook that sets the plan, a customer portal for cancellations.
- Week 5Usage limits and deploy
Per-plan quotas from recorded tokens, provider spend limits, Vercel Pro.
- Week 6Launch to your interview list
Ask the people from week 1 to pay, then watch them use it.
Step 1: Validate the problem before you write code
- Talk to people who have the problem. Ask how they handle it today, what it costs in time or money, and what they have tried. Look for a painful, frequent task, not a nice-to-have.
- Apply the chatbot test. If a customer could get the same result by pasting a prompt into ChatGPT or Claude, your product needs to add something: their data, their tools, a reliable format, or a workflow they would otherwise do by hand.
- Ask for commitment. A paid pilot or a pre-order at a stated price tells you more than compliments. Decide in advance what result makes you build and what makes you stop.
- Do the job manually first. Run the prompts yourself for a few early customers. You learn what good output looks like and collect the examples you will test against.
Step 2: Build the AI route first
The first code you write is the one server route that does the job. A minimal Route Handler that calls OpenAI's Responses API from the server:
// app/api/summarize/route.ts
import OpenAI from 'openai'
const openai = new OpenAI() // reads OPENAI_API_KEY on the server
export async function POST(request: Request) {
// Check the signed-in user and their remaining quota here.
const body = await request.json().catch(() => null)
const text = body?.text
if (typeof text !== 'string' || text.length === 0 || text.length > 20000) {
return Response.json({ error: 'Send 1 to 20,000 characters.' }, { status: 400 })
}
const response = await openai.responses.create({
model: 'gpt-6-luna',
instructions: 'Summarize the text in three short bullet points.',
input: text,
max_output_tokens: 400,
})
// Record response.usage against the user before returning.
return Response.json({ summary: response.output_text })
}Keep API keys in server-only environment variables. Next.js inlines anything prefixed NEXT_PUBLIC_ into the JavaScript sent to the browser (environment variables docs), so never use that prefix for a secret. For long answers, the AI SDK's streamText streams output so users see progress. Our guides to getting an OpenAI API key and a Claude API key cover key setup and spend limits.
Build the test set in the same week. Take 20 to 50 real inputs from your manual runs, write down what a good answer contains for each, and keep them in a file next to the route. A short script that runs every example through the route and flags missing fields or wrong formats is enough to start. Re-run it on every prompt or model change; it is the only honest way to tell whether a cheaper model is good enough, and it is the check an AI coding agent needs to verify its own changes to the route.
Steps 3 to 5: sign-in, checkout and limits
- Sign-in with Supabase Auth.
- Tables for users, plans, jobs and outputs, with Row Level Security. Supabase's RLS guide says to enable RLS on every table in an exposed schema. Our Supabase full-stack tutorial walks through it.
- Checkout through Stripe, with a webhook that updates the user's plan and limits. Treat the webhook, not the redirect after payment, as the source of truth.
- Limits that read the token usage you recorded in step 2, plus a hard monthly spend limit at the model provider as a backstop.
Which tech stack should an AI SaaS use?
A common 2026 default, with each vendor's prices checked October 2026:
| Layer | Tool | Cost | What to know |
|---|---|---|---|
| App and API routes | Next.js 16.3, App Router | Free, open source | Route Handlers and Server Functions run server code; patch to 16.3.8 or later |
| Hosting | Vercel | Hobby free (non-commercial only); Pro $20 a month per deploying seat, including $20 usage credit | Functions default to 300 seconds; Pro can raise it to 800, or 30 minutes per function in beta |
| Database, auth, storage, vectors | Supabase | Free: 50,000 MAU, 500 MB database, 2 active projects. Pro from $25 a month: 100,000 MAU, 8 GB disk | Free projects pause after a week of inactivity; Pro spend caps are on by default |
| Streaming UI | AI SDK (the ai package, v7) | Free, open source | streamText streams model output to the browser |
| AI model | OpenAI or Anthropic API | Per token; see the cost table below | Billed separately from ChatGPT and Claude subscriptions |
| Payments | Stripe | 2.9% + 30 cents per successful US card payment; Billing and Tax cost extra | Managed Payments (merchant of record) adds 3.5% per transaction |
Three details that catch first-time founders:
- Vercel Hobby cannot host a paid product. Vercel's guidelines restrict Hobby to non-commercial personal use and count any method of requesting or processing payment from visitors as commercial.
- Keep Next.js patched. The September 2026 security release fixed a high-severity server-side request forgery issue in image optimization, among others; update to 16.3.8 or later.
- Merchant of record is a real choice. With plain Stripe you are the seller and handle sales tax and VAT yourself (Stripe Tax helps, for a fee). Stripe's Managed Payments acts as merchant of record for digital products for an extra 3.5% per transaction, subject to an eligibility review.
What is an AI SaaS builder, and do you need one?
People searching "AI SaaS builder" usually mean one of three things. No-code app generators build a working app from a prompt. AI coding agents such as Claude Code write code in your own repository, run your tests and open pull requests; our Claude Code guide covers how to use one well. And courses teach the whole path; ours is called AI SaaS Builder and builds one product on the stack above, from validation to Stripe billing.
- Page layouts and forms
- CRUD screens and simple API routes
- Boilerplate for auth and checkout
- Refactors with tests to check them
- Row Level Security policies on every table
- API keys never reaching the browser
- Stripe webhook signature checks
- Quota checks before every model call
- Prompt changes against your test set
How should you price an AI SaaS around token costs?
Cost per task = input tokens × input price + output tokens × output price. Reasoning or "thinking" tokens count as output on both OpenAI and Anthropic, so measure real usage from the API response rather than estimating from the visible answer. List prices per million tokens, checked October 2026, and the cost of one illustrative task with 6,000 input and 800 output tokens:
| Model | Input | Output | Cost per task | Per 300 tasks |
|---|---|---|---|---|
| GPT-6 Luna | $0.10 | $0.50 | $0.001 | $0.30 |
| Claude Haiku 5.5 (prompts up to 100K) | $0.10 | $0.50 | $0.001 | $0.30 |
| GPT-6.1 Sol | $2 | $10 | $0.020 | $6.00 |
| Claude Sonnet 5.5 | $2 | $10 | $0.020 | $6.00 |
| Claude Opus 5.5 | $4 | $20 | $0.040 | $12.00 |
| GPT-6 Astra | $10 | $50 | $0.100 | $30.00 |
Illustrative task: 6,000 input and 800 output tokens. Computed from list prices. Source: OpenAI and Anthropic API pricing pages, checked October 2026
Hypothetical example, not a forecast: say you charge $19 a month for up to 300 tasks. A customer who uses every task on Claude Sonnet 5.5 costs $6.00 in tokens, and Stripe's US card fee on $19 is about $0.85, leaving about $12.15 before subscription-billing and tax fees. Fixed platform costs of $45 a month (Vercel Pro plus Supabase Pro) are covered by roughly four customers at that usage. Run the same plan on GPT-6 Astra and a heavy user costs $30 in tokens, more than they pay. To run this with your own prices, plans and churn, All Access members can use our AI SaaS profit simulator, which models gross margin per plan, heavy-user cost and MRR; anyone can see a sample of its output on that page.
- Cap every request with a maximum output token setting, and cap every plan with a usage limit.
- Cache repeated prompts. Both providers discount cached input heavily; put stable instructions first.
- Batch what can wait. OpenAI's and Anthropic's batch processing costs 50% less for asynchronous work.
- Route by difficulty. Send easy cases to a small model and only the hard ones to an expensive model, and re-run your test set when you change the routing.
Provider detail is in our Claude pricing guide and ChatGPT API workflows guide.
Launch to the people you interviewed
- Email everyone from your validation interviews with a direct payment link
- RLS enabled and tested with a second account
- Stripe webhook verified in live mode with a real card
- Provider spend limits set at OpenAI or Anthropic
- Privacy policy names the AI providers that process customer data
- An AI disclosure wherever users talk to a chatbot
- A way for customers to report a bad output
- Dashboard for sign-ups that finish the core task, week-two return and token cost per customer
- Start with your validation list. The people who described the problem are your first users; ask them to pay, then watch them use it.
- Go where your customers already are: industry communities, forums and newsletters, following each one's rules on self-promotion.
- Write about the problem, not the product. Guides that answer your customers' real questions keep bringing search and AI-assistant traffic long after launch day.
- Treat launch sites such as Product Hunt or Show HN as a way to get feedback, not a growth plan.
Cover the legal and trust basics
- Privacy: say in your privacy policy which AI providers process customer data, and check each provider's data terms.
- EU AI Act transparency: the European Commission says these rules apply from August 2026. People using an AI system such as a chatbot must be told they are interacting with a machine, and providers of generative AI must make AI-generated content identifiable (European Commission).
- Honest claims: in its Operation AI Comply sweep, the US FTC acted against companies over deceptive AI claims. Do not promise accuracy, savings or income you cannot back up.
- Human review for anything high-stakes, such as legal, medical or financial output.
Wrapper or product? What makes it last
Starting as a thin layer over a model API is fine. What keeps customers once competitors copy your prompt is usually workflow fit (it works inside the CRM, inbox or files they already use), their data (documents or history they bring, with permission), reliability (structured, checked output backed by your test set), or distribution (you reach one niche better than a general tool can). If you would rather sell AI automation as a service than build a product, our n8n OpenAI integration guide and AI agent automation guide show that route.
Mistakes to avoid
- Building for months before a single customer has used the core feature.
- Shipping an API key to the browser, or skipping Row Level Security.
- Unlimited plans on a per-token cost base, or no spend limit with your model provider.
- Launching a paid product on Vercel's non-commercial Hobby plan.
- Switching models or prompts without re-running your test set.
- Marketing claims about accuracy, time saved or earnings that you cannot support.
How to build an AI SaaS: FAQ
How much does it cost to build an AI SaaS in 2026?
Development can cost nothing beyond your time: Next.js and the AI SDK are free, and Vercel, Supabase and both major LLM APIs let you start on free or small prepaid tiers. Once you charge customers, expect about $45 a month in platform fees (Vercel Pro at $20 and Supabase Pro from $25), plus model usage and Stripe's 2.9% + 30 cents per US card payment. Checked October 2026.
What is the best tech stack for an AI SaaS?
There is no single best stack, but a common 2026 default is Next.js with the App Router on Vercel for the app and API routes, Supabase for Postgres, authentication, storage and vector search, the AI SDK for streaming, an LLM API from OpenAI or Anthropic, and Stripe for payments. Pick tools you can debug yourself at two in the morning, not the newest ones.
Which LLM API should I use for a SaaS product?
Test two or three models on real examples of your task and compare quality and cost per task. Checked October 2026, list prices per million input and output tokens run from $0.10 and $0.50 for GPT-6 Luna and Claude Haiku 5.5, to $2 and $10 for GPT-6.1 Sol and Claude Sonnet 5.5, $4 and $20 for Claude Opus 5.5, and $10 and $50 for GPT-6 Astra.
Can I run a paid AI SaaS on Vercel's free plan?
No. Vercel's fair use guidelines restrict the Hobby plan to non-commercial personal use and list any method of requesting or processing payment from visitors as commercial use. A paid product needs the Pro plan, which costs $20 a month per deploying seat and includes $20 of monthly usage credit, checked October 2026.
How do I stop API costs from eating my margin?
Calculate the model cost per task before you set prices, cap output tokens, limit usage per plan, use the smallest model that passes your tests, cache repeated prompts, batch work that can wait, and set spend limits with your model provider. Avoid unlimited plans when each request has a real token cost, and re-check the numbers whenever you change models.
What is an AI SaaS builder?
The phrase covers three things: no-code app generators that build an app from a prompt, AI coding agents such as Claude Code that write code in your own repository, and courses that teach the whole build. Any of them can get you to a demo. Before you charge money, check the parts generated code most often gets wrong: authentication, database access rules, payment webhooks and usage limits.
Is an AI wrapper a viable business?
It can be a starting point, but if your product is a prompt, customers can type it into ChatGPT or Claude themselves. Durable products usually add something a general chatbot lacks: integration into a specific workflow, data the customer brings, reliable structured output checked against tests, or distribution in a niche you understand better than a general tool can.
Build the product, not another tutorial project.
AI SaaS Builder, included in All Access, takes one AI product from validation to Stripe billing on Next.js, Supabase and the Claude API. Members also get the AI SaaS profit simulator, the other three programs, live coaching and the private community in one subscription.
Building your first AI SaaS?
Bring your stack and pricing questions to the free Discord, where members share builds and launch notes, and compare model prices in our LLM API pricing guide.