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.

For example: a chatbot, an AI writing or research tool, document Q&A, an agent that calls your APIs, an AI feature in an existing app.

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. 1

    A framework

    Pages, server routes that call the model with your secret key, and streaming responses to the browser.

    Next.js

    Free, open source

    Server routes and streaming built in, and most AI app examples and SDKs start from it.

    Also worth a look: SvelteKit, Nuxt · compare all frameworks →

  2. 2

    UI components

    Chat input, message lists, dialogs and settings screens that work with a keyboard and screen reader.

    shadcn/ui

    Free, open source

    Copy-in components styled with Tailwind that you can reshape into a chat interface.

    Also worth a look: Mantine · compare all UI libraries →

  3. 3

    A model API

    The language model itself, called from your server and billed per million tokens in and out.

    OpenRouter

    Free 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 API

    Free tier, then usage-based

    Not stated

    Free tokens on most Gemini Flash models with rate limits, enough to build and demo.

    Also worth a look: OpenAI API, Claude API, GroqCloud · compare all AI APIs →

  4. 4

    Somewhere to run it

    Builds and serves the app from GitHub, including the server routes that call the model.

    Vercel

    Free 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.

    Also worth a look: Railway, Cloudflare Workers (incl. Pages) · compare all paaS →

  5. 5

    A database with vectors

    Users, chats and settings, plus embeddings (vectors) if the app searches your own documents.

    Supabase

    Free 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.

    Also worth a look: Neon · compare all databases →

  6. 6

    Long-running AI work

    Optional

    Agents, document processing and multi-step calls can take minutes, longer than a web request is allowed to run.

    Trigger.dev

    Free 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.

    Also worth a look: Inngest · compare all jobs and queues →

  7. 7

    User sign-in

    So you know whose chats are whose, and can limit how much each person uses.

    Clerk

    Free tier, then from $25/mo

    Not stated Their branding

    Ready-made sign-in screens for Next.js, free up to 50,000 monthly users.

    At $0

    Better Auth

    Free, open source

    Open-source and free, with users stored in your own database.

    Also worth a look: Supabase · compare all auth →

  8. 8

    Charging for it

    Optional

    Model calls cost you money per use, so paid plans or credits usually arrive early in an AI app.

    Polar

    Usage-based

    Merchant of record with subscriptions, usage billing and credits built in; it also handles sales tax and VAT.

    Also worth a look: Stripe Billing, Paddle · compare all payments →

  9. 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.

    Porkbun

    From $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.

    Also worth a look: Cloudflare Registrar, Namecheap · compare all registrars →

  10. 10

    Knowing when it breaks

    Optional

    Model calls fail, time out and hit rate limits. An error tracker tells you which and where.

    Sentry

    Free tier, then from $26/mo

    Stops at the limit

    The free Developer plan covers 5,000 errors a month.

    Also worth a look: Better Stack · compare all monitoring →

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.