Platform Hopper: Guide (Build Your Own AI Chatbot)
◀ Back to Buddy List
How to Build Your Own AI Character Chatbot for Free
By loamy ยท June 2026 ยท Estimated time: ~2 hours
Why Build Your Own?
Every platform reviewed on this site has tradeoffs: content filters you can't control, models you didn't choose, pricing that changes, or privacy policies that make you nervous. Building your own AI character chatbot means you own the whole stack. You pick the model. You set the rules. You control the data.

The best part? You don't need to know how to code. You can use Claude.ai (Anthropic's free AI assistant) to write the entire application for you. You just describe what you want in plain English, and it generates the code.

This guide walks you through building a web-based AI character chatbot using free tiers of everything: Claude.ai, OpenRouter (for AI model access), GitHub (for code hosting), and Vercel (for deployment). When you're done, you'll have a working chatbot live on the internet.
๐Ÿ“น Video Tutorial
๐ŸŽฌ Video tutorial coming soon
Prefer video? This walkthrough covers every step below. Subscribe to Platform Hopper on YouTube for more guides.
What You'll Need
Claude.ai Free account at claude.ai. This is the AI that writes all the code for you. No coding knowledge needed.
GitHub Free account at github.com/signup. This is where your code lives.
OpenRouter Free account at openrouter.ai. This gives you access to dozens of AI models through one API, including free ones.
Vercel Free account at vercel.com/signup. This hosts your chatbot on the web for free.
Step 1: Set Up Your Accounts
Create accounts on all four services. All free tiers, no credit card required.

Claude.ai: Go to claude.ai and sign up. This is your AI coding assistant. You'll paste prompts into the chat and it will generate your entire project.

GitHub: Go to github.com/signup. You'll use this to store and version your code. If you already have an account, skip this.

OpenRouter: Go to openrouter.ai and sign up. Once you're in, go to Keys in the dashboard and create an API key. Copy it somewhere safe, because you'll need it later. OpenRouter gives you access to free models as well as paid options if you want to upgrade later.

Vercel: Go to vercel.com/signup. Sign up with your GitHub account so that deployment is automatic later.
Step 2: Write Your Character Definition
Before you build anything, you need to define your character. If you've used platforms like Character AI, Janitor AI, or any of the apps reviewed on this site, you're already familiar with this process. The difference is that instead of filling in separate boxes on a platform, you'll write it all in one block of text that becomes your character's "system prompt."

You can write one from scratch, or you can copy a character definition you already have from another platform and adapt it. Here's a template you can fill in:

CHARACTER DEFINITION Name: [character name] Personality: [describe their core traits, e.g. "sarcastic but secretly caring, fiercely loyal, hates small talk, loves bad puns"] Backstory: [who they are, where they come from, what shaped them] Speaking Style: [how they actually talk, e.g. "uses lowercase, lots of ellipses, never uses exclamation marks, speaks in short blunt sentences" or "formal and poetic, uses old-fashioned language, addresses the user as 'dear one'"] Example Messages: User: "Hey, how's it going?" Character: "[write how YOUR character would respond]" User: "Tell me about yourself." Character: "[write how YOUR character would respond]" User: "I'm having a bad day." Character: "[write how YOUR character would respond]" Things They Would Never Do: - [e.g. "break character," "use modern slang," "be mean without reason"] Topics They Know About: - [e.g. "medieval history," "magic systems," "coffee"] Topics They Avoid: - [e.g. "politics," "their past"]

Tips for better characters:
The example messages matter more than anything else. They teach the AI how your character actually sounds, not just what they're like on paper.
Be specific about speaking style. "Friendly" is vague. "Uses lots of emoji, types in all lowercase, rambles when excited, says 'dude' constantly" is something the AI can actually follow.
If you're copying a character from another platform, grab the description, personality fields, and any example dialogues. Combine them into the template above.
Test and iterate. Your first version won't be perfect, and that's fine. You can always update the definition later.
Step 3: Ask Claude to Build Your Chatbot
Go to claude.ai and start a new conversation. Paste in a prompt like this, with your character definition from Step 2 included:

Build me a complete Next.js web app that is an AI character chatbot. Here's what I want: - A chat interface where users talk to an AI character - Use the OpenRouter API for the AI model (I'll provide my API key as an environment variable called OPENROUTER_API_KEY) - Use a free model from OpenRouter - The system prompt should use the character definition I've included below - Include a simple, clean chat UI with message history - Store chat history in the browser so it persists between visits - Make it mobile-friendly - Make it ready to deploy on Vercel - Include a package.json and all necessary config files Here is my character definition: [PASTE YOUR CHARACTER DEFINITION FROM STEP 2 HERE]

Claude will generate the full project: file structure, components, API routes, styling, everything. It will show you each file with its contents.

Important: Claude.ai will give you the code as text in the chat. You'll need to create the files on your computer manually (copy each file's contents into a new file with the correct filename) or ask Claude to package it as a downloadable zip. If you're not sure how to do this, just ask Claude: "Can you give me step-by-step instructions for saving these files to my computer?"
Step 4: Test It Locally
Once you've saved all the files to a folder on your computer, open your terminal (on Mac: Terminal app, on Windows: PowerShell) and navigate to that folder. Then install the dependencies and run the app:

cd my-ai-chatbot npm install echo "OPENROUTER_API_KEY=your-key-here" > .env.local npm run dev

Open http://localhost:3000 in your browser. You should see your chatbot. Talk to it. Does the character feel right? If not, go back to Claude.ai and ask it to adjust the system prompt or behavior. You can paste in your conversation and say "the character sounds too formal, can you make the system prompt more casual?"

Common tweaks to ask Claude for:
"Make the character more sarcastic / formal / shy"
"Add a character avatar image at the top"
"Add a 'New Chat' button to clear the conversation"
"Add dark mode"
"The character keeps breaking character when I ask about [topic], can you fix the system prompt?"
Step 5: Push to GitHub
Create a new repository on GitHub (click the + in the top right, then "New repository"). Name it whatever you want. Keep it public or private, your choice.

Then push your code from the terminal:

git init git add . git commit -m "initial commit: ai character chatbot" git remote add origin https://github.com/YOUR-USERNAME/YOUR-REPO-NAME.git git push -u origin main

Important: Make sure your .env.local file is in .gitignore so your API key doesn't get published. Claude should have set this up, but double-check.

If you're not comfortable with the terminal, you can also upload files directly through GitHub's web interface. Just go to your new repository and click "Add file" then "Upload files."
Step 6: Deploy to Vercel
Go to vercel.com/new. Import your GitHub repository. Vercel will auto-detect that it's a Next.js project.

Before deploying, add your environment variable:
Go to Environment Variables in the Vercel setup
Add OPENROUTER_API_KEY with your API key as the value
Click Deploy

Vercel will build and deploy your app. In about 60 seconds, you'll get a live URL like your-chatbot.vercel.app. That's it: your AI character chatbot is live on the internet.

Every time you push changes to GitHub, Vercel automatically redeploys. So you can keep improving your chatbot and it updates itself.
What's Next?
You've got a working chatbot. Here are some ideas for making it better:

Add multiple characters: ask Claude to add a character selection screen so users can pick who they want to talk to
Add memory: store conversation summaries so the character remembers past chats
Upgrade your model: add a few dollars to your OpenRouter account and switch to a paid model for dramatically better roleplay quality. Browse OpenRouter's model list to compare options.
Custom domain: buy a domain name and connect it to Vercel for free
Share it: send the link to friends or post it on r/characterairunaways

Want to deploy a chatbot to Discord instead? Check out the companion guide: How to Deploy an AI Character Chatbot to Discord.
FAQ
Is this actually free?
Yes, if you stay on free tiers. OpenRouter has free models. Vercel's free tier handles hobby traffic. Claude.ai's free tier is enough to generate and iterate on a project this size. GitHub is free for public and private repos.

Do I need to know how to code?
No. Claude.ai writes the code for you. You describe what you want in plain English. That said, being able to read code helps you understand what's happening, and you'll naturally pick it up as you go. If you get stuck at any point, just paste the error message into Claude and ask for help.

How good is the AI roleplay compared to Character AI?
It depends entirely on the model you choose and the quality of your character definition. Free models are decent but basic. Paid models through OpenRouter can match or exceed Character AI quality, especially with a well-written system prompt and good example messages.

Can other people use my chatbot?
Yes, anyone with the Vercel URL can use it. Your OpenRouter API key pays for the model usage, so keep an eye on costs if you share widely. You can add authentication if you want to restrict access.

Can I add NSFW content?
You control the content filter because it's your app. The model's behavior depends on the model provider's policies. Some models on OpenRouter are unfiltered, others aren't. Check the model details on OpenRouter before choosing.

Can I use a character definition from Character AI or another platform?
Absolutely. Copy the character's name, description, personality, and any example dialogues from the other platform. Paste them into the character definition template in Step 2 and adjust as needed. The format is slightly different but the content transfers directly.

Can I do this entire guide on mobile?
Mostly, yes. Claude.ai, GitHub, OpenRouter, and Vercel all work in a mobile browser. You can generate the code, create your accounts, set up your repo, and deploy to Vercel from your phone. The only step that's easier on a desktop is saving the code files and running terminal commands (Step 4). If you don't have a computer, you can skip local testing entirely: create your repo on GitHub's mobile site, upload the files Claude gives you, and connect it to Vercel. It'll deploy without you ever opening a terminal.
Guide: Build Your Own AI Chatbot | Platform Hopper