Tech stack for an AI app or chatbot
An AI app is a normal web app with one expensive, slow dependency: the model. Keep model calls on the server, stream replies to the browser, move long work into background jobs, and set a spending limit before anyone else can use it.
Cost Hosting and database start at $0; the model API is pay-per-use, from cents a day while you test. Set a spend limit or buy prepaid credits before sharing the link.
- 1
A framework
Pages, server routes that call the model with your secret key, and streaming responses to the browser.
Next.jsFree, open source
Server routes and streaming built in, and most AI app examples and SDKs start from it.
- 2
UI components
Chat input, message lists, dialogs and settings screens that work with a keyboard and screen reader.
shadcn/uiFree, open source
Copy-in components styled with Tailwind that you can reshape into a chat interface.
- 3
A model API
The language model itself, called from your server and billed per million tokens in and out.
OpenRouterFree tier
Not stated
Try models from OpenAI, Anthropic, Google and open-weight makers with one key, and switch by changing a model name. 5.5% fee on credit purchases.
At $0
Gemini APIFree tier, then usage-based
Not stated
Free tokens on most Gemini Flash models with rate limits, enough to build and demo.
- 4
Somewhere to run it
Builds and serves the app from GitHub, including the server routes that call the model.
VercelFree tier, then from $20/mo
Pauses Non-commercial only
Made by the Next.js team, with streaming responses supported. Hobby is non-commercial; Pro is $20 a month.
- 5
A database with vectors
Users, chats and settings, plus embeddings (vectors) if the app searches your own documents.
SupabaseFree tier, then from $25/mo
Stops at the limit Paused if unused No backups
Postgres with pgvector for embeddings, plus sign-in and file storage in one project. Free projects pause after a week of inactivity.
- 6
Long-running AI work
OptionalAgents, document processing and multi-step calls can take minutes, longer than a web request is allowed to run.
Trigger.devFree tier, then from $10/mo
Stops at the limit
Runs TypeScript tasks with no time limit and retries; a free monthly usage credit to start.
- 7
User sign-in
So you know whose chats are whose, and can limit how much each person uses.
ClerkFree tier, then from $25/mo
Not stated Their branding
Ready-made sign-in screens for Next.js, free up to 50,000 monthly users.
- 8
Charging for it
OptionalModel calls cost you money per use, so paid plans or credits usually arrive early in an AI app.
PolarUsage-based
Merchant of record with subscriptions, usage billing and credits built in; it also handles sales tax and VAT.
- 9
A domain name
The address people type (yourname.com). Your host gives you a free subdomain to start with, so this can wait until you have something to show. Compare renewal prices, not the first-year offer.
PorkbunFrom $11.08/yr
The same price for a .com in year one and at renewal, with free WHOIS privacy.
At $0
No free option
No registrar is free. A .com costs about $11 a year at a registrar that renews at the first-year price; free subdomains from your host work until then.
- 10
Knowing when it breaks
OptionalModel calls fail, time out and hit rate limits. An error tracker tells you which and where.
SentryFree tier, then from $26/mo
Stops at the limit
The free Developer plan covers 5,000 errors a month.
What can wait
- Fine-tuning or hosting your own model. Prompting a hosted model covers almost every first version.
- A separate vector database while Postgres with pgvector keeps up.
- An agent framework before you have one working prompt.
What do I need to build an AI app or chatbot?
A framework, UI components, A model API, Somewhere to run it, A database with vectors, User sign-in, A domain name. Hosting and database start at $0; the model API is pay-per-use, from cents a day while you test. Set a spend limit or buy prepaid credits before sharing the link.
Which AI API should I use for my app?
Test your real prompts on two or three models first; quality differs by task. A router such as OpenRouter makes that easy, and you can go direct to the vendor later for its own features and prices.
How do I stop an AI app from running up a huge bill?
Use prepaid credits or a provider spend limit, require sign-in, and cap how many requests each user can make per day.