Build an AI chatbot
Give your product a brain. Up and running without managing servers.
Tools that power the Build an AI chatbot stack
- 1OpenAI
Create an OpenAI account and generate an API key from the API Keys page. Store this key securely as an environment variable called OPENAI_API_KEY. Choose a model like gpt-4o-mini for cost-effective conversations or gpt-4o for more complex reasoning tasks.
Open OpenAI - 2Vercel AI SDK
Install the Vercel AI SDK with npm install ai openai. Create an API route that initializes the OpenAI client and uses streamText() to stream responses back to the client. This handles all the complexity of streaming and provides React hooks for your chat UI.
Open Vercel AI SDK - 3Supabase
Create a conversations table with columns for id, user_id, created_at, and a messages JSONB column to store the chat history. Enable Row Level Security so users can only access their own conversations. Use the Supabase client to save and load conversation history.
Open Supabase
Frequently asked questions
Costs depend on your scale. Most tools in this stack offer a free tier to start. Open the cost calculator on this page to estimate monthly cost based on your users and revenue.
This stack uses 3 tools: OpenAI, Supabase, Vercel AI SDK. Each tool is picked to work well with the others and to cover a specific part of the workflow.
Yes. The stack is a recommended starting point. You can replace any tool with an alternative you already use. Check the setup guide first to confirm the integration points you'll need to rebuild.
Most makers finish the 3-step setup in under an hour. Creating accounts and connecting the first integration takes the most time.
Related stacks
Accept payments online
Start getting paid. Everything wired together so nothing falls through the cracks.
Shares: Supabase (relevance score 3)
See the full Accept payments online workflowSend product updates that stick
Keep users in the loop and coming back. Timely updates that reduce churn.
Shares: Supabase (relevance score 3)
Send product updates that stick setup guidePower your mobile app
Ship your mobile app without building a backend from scratch. Running in hours.
Shares: Supabase (relevance score 3)
Explore the Power your mobile app stackSet up customer support system
Keep customers happy from day one. No duct-taping three dashboards together.
How to build Set up customer support systemBrowse more stacks by category
Have a better stack?
Share your favorite tool combination and help other builders.