Open-source Character.AI alternative — chat with preset personas or build custom AI characters, with per-chat LLM tuning. Built on Next.js, Prisma, Supabase, NextAuth, and Stripe.
45
stars
18
commits
JavaScript
primary language
Jul 27, 2026
updated
An interactive, high-fidelity AI companion portal where users explore preset personas, forge custom AI characters, and fine-tune LLM parameters per chat. Built with Next.js (App Router), this application is a self-contained SaaS boilerplate featuring user authentication, credit billing, and a beautiful chat interface powered by the MuAPI engine.
https://github.com/user-attachments/assets/b6e252c0-6e06-4333-bc53-5d6856811868
GitHub Repository: github.com/Anil-matcha/open-character-ai
Live Demo: open-character-ai.vercel.app
Sign in with Google to explore preset characters, customize your own companion, tune generation parameters in real-time, and manage credit tokens.
Open Character AI is a production-ready, highly-optimized AI web application. Out of the box, it seamlessly manages User Authentication, Credits & Billing, Chat Persistence, and real-time LLM interaction utilizing a sleek Next.js (App Router) architecture. It empowers creators, developers, and brands to host their own custom companion portals.
Why use Open Character AI?

/[character_name]/[id])Temperature, Max Tokens, and edit/override System Prompt instructions per session./)/pricing)This application shares a single PostgreSQL database instance on Supabase with other applications in this workspace. Running npx prisma db push on a clean, empty schema will drop tables belonging to other applications. Always follow the Pull-Declare-Push-Cleanup sequence:
npx prisma db pull to fetch all existing tables into your local schema.prisma.Character, Chat, Message, Creation, UserImage) and update their relations inside the User model.npx prisma db push to safely update the database schema without touching or dropping existing tables of other apps.schema.prisma to keep the code clean and compile compact types (retain only Account, Session, User, VerificationToken, your custom tables, and the User relations).npx prisma generate to rebuild the type-safe Prisma client for your selected models.This architecture is engineered explicitly for Vercel serverless environments.
To successfully deploy and run, populate the following environment variables in your Vercel project settings:
| Service | Variable | Description & Source |
|---|---|---|
| Database | DATABASE_URL | PostgreSQL connection string (Supabase or Neon) |
DIRECT_URL | Direct DB connection for Prisma migrations and schema introspections | |
| NextAuth / Google | NEXTAUTH_SECRET | Secure random string generated via openssl rand -base64 32 |
NEXTAUTH_URL | Your production domain (e.g. https://open-character-ai.vercel.app) | |
GOOGLE_CLIENT_ID | Get from Google Cloud Console | |
GOOGLE_CLIENT_SECRET | Get from Google Cloud Console | |
| Stripe Billing | STRIPE_SECRET_KEY | Get from Stripe Dashboard |
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY | Get from Stripe Dashboard | |
STRIPE_WEBHOOK_SECRET | Webhook secret for resolving credit purchases | |
| AI Generator / LLM | MU_API_KEY | API key from muapi.ai (for model routing/API calls) |
WEBHOOK_URL | Webhook URL endpoint for async events | |
| UI Configuration | NEXT_PUBLIC_THEME | Dynamic UI color theme accent: Choose from indigo, emerald, rose, amber, violet |
/api/stripe/webhook.# 1. Clone the repository
git clone https://github.com/Anil-matcha/open-character-ai
cd open-character-ai
# 2. Install dependencies
npm install
# 3. Setup Environment
cp .env.example .env
# Open .env and insert your specific keys.
# 4. Initialize Database Schema
# Note: Because the database is shared, see the Safety Warning above!
npx prisma generate
npx prisma db push
# 5. Start the Development Server
npm run dev
The console should now be active on http://localhost:3000.
character-ai/
├── prisma/
│ └── schema.prisma # Postgres schema (User, Account, Session, Character, Chat, Message, Creation, UserImage)
├── src/
│ ├── app/ # Next.js App Router
│ │ ├── page.js # Dashboard / Character selection & custom character builder modal
│ │ ├── layout.js # Root layout importing fonts, background styles, and Providers
│ │ ├── globals.css # Global cyber/dark styling utilities and variables
│ │ ├── pricing/ # Credit purchase plans & checkout triggers (/pricing)
│ │ │ └── page.js
│ │ ├── [character_name]/[id]/
│ │ │ └── page.js # Interactive chat interface with parameter controls and message list
│ │ └── api/
│ │ ├── auth/ # NextAuth Google OAuth handler
│ │ ├── characters/ # GET / POST characters (custom builder handler)
│ │ ├── chats/ # GET / POST chats, messages list, parameters tuning
│ │ │ ├── [id]/
│ │ │ │ └── messages/ # GET / POST messages for a specific chat
│ │ │ └── route.js
│ │ ├── images/ # Upload/CDN helpers for avatars
│ │ ├── stripe/ # Checkout session creation & payment webhooks
│ │ └── upload/ # File uploading helper endpoint
│ ├── components/
│ │ └── Providers.jsx # NextAuth SessionProvider wrapper
│ └── lib/
│ ├── auth.js # NextAuth configuration with Google OAuth and Prisma adapter
│ └── prisma.js # Global PrismaClient singleton with PG adapter
└── next.config.mjs # Next.js configuration
MIT Licensed.
14 commits
4 commits
JavaScript
97.9%
CSS
2.0%
Open-source Character.AI alternative — chat with preset personas or build custom AI characters, with per-chat LLM tuning. Built on Next.js, Prisma, Supabase, NextAuth, and Stripe.
45
stars
18
commits
JavaScript
primary language
Jul 27, 2026
updated
An interactive, high-fidelity AI companion portal where users explore preset personas, forge custom AI characters, and fine-tune LLM parameters per chat. Built with Next.js (App Router), this application is a self-contained SaaS boilerplate featuring user authentication, credit billing, and a beautiful chat interface powered by the MuAPI engine.
https://github.com/user-attachments/assets/b6e252c0-6e06-4333-bc53-5d6856811868
GitHub Repository: github.com/Anil-matcha/open-character-ai
Live Demo: open-character-ai.vercel.app
Sign in with Google to explore preset characters, customize your own companion, tune generation parameters in real-time, and manage credit tokens.
Open Character AI is a production-ready, highly-optimized AI web application. Out of the box, it seamlessly manages User Authentication, Credits & Billing, Chat Persistence, and real-time LLM interaction utilizing a sleek Next.js (App Router) architecture. It empowers creators, developers, and brands to host their own custom companion portals.
Why use Open Character AI?

/[character_name]/[id])Temperature, Max Tokens, and edit/override System Prompt instructions per session./)/pricing)This application shares a single PostgreSQL database instance on Supabase with other applications in this workspace. Running npx prisma db push on a clean, empty schema will drop tables belonging to other applications. Always follow the Pull-Declare-Push-Cleanup sequence:
npx prisma db pull to fetch all existing tables into your local schema.prisma.Character, Chat, Message, Creation, UserImage) and update their relations inside the User model.npx prisma db push to safely update the database schema without touching or dropping existing tables of other apps.schema.prisma to keep the code clean and compile compact types (retain only Account, Session, User, VerificationToken, your custom tables, and the User relations).npx prisma generate to rebuild the type-safe Prisma client for your selected models.This architecture is engineered explicitly for Vercel serverless environments.
To successfully deploy and run, populate the following environment variables in your Vercel project settings:
| Service | Variable | Description & Source |
|---|---|---|
| Database | DATABASE_URL | PostgreSQL connection string (Supabase or Neon) |
DIRECT_URL | Direct DB connection for Prisma migrations and schema introspections | |
| NextAuth / Google | NEXTAUTH_SECRET | Secure random string generated via openssl rand -base64 32 |
NEXTAUTH_URL | Your production domain (e.g. https://open-character-ai.vercel.app) | |
GOOGLE_CLIENT_ID | Get from Google Cloud Console | |
GOOGLE_CLIENT_SECRET | Get from Google Cloud Console | |
| Stripe Billing | STRIPE_SECRET_KEY | Get from Stripe Dashboard |
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY | Get from Stripe Dashboard | |
STRIPE_WEBHOOK_SECRET | Webhook secret for resolving credit purchases | |
| AI Generator / LLM | MU_API_KEY | API key from muapi.ai (for model routing/API calls) |
WEBHOOK_URL | Webhook URL endpoint for async events | |
| UI Configuration | NEXT_PUBLIC_THEME | Dynamic UI color theme accent: Choose from indigo, emerald, rose, amber, violet |
/api/stripe/webhook.# 1. Clone the repository
git clone https://github.com/Anil-matcha/open-character-ai
cd open-character-ai
# 2. Install dependencies
npm install
# 3. Setup Environment
cp .env.example .env
# Open .env and insert your specific keys.
# 4. Initialize Database Schema
# Note: Because the database is shared, see the Safety Warning above!
npx prisma generate
npx prisma db push
# 5. Start the Development Server
npm run dev
The console should now be active on http://localhost:3000.
character-ai/
├── prisma/
│ └── schema.prisma # Postgres schema (User, Account, Session, Character, Chat, Message, Creation, UserImage)
├── src/
│ ├── app/ # Next.js App Router
│ │ ├── page.js # Dashboard / Character selection & custom character builder modal
│ │ ├── layout.js # Root layout importing fonts, background styles, and Providers
│ │ ├── globals.css # Global cyber/dark styling utilities and variables
│ │ ├── pricing/ # Credit purchase plans & checkout triggers (/pricing)
│ │ │ └── page.js
│ │ ├── [character_name]/[id]/
│ │ │ └── page.js # Interactive chat interface with parameter controls and message list
│ │ └── api/
│ │ ├── auth/ # NextAuth Google OAuth handler
│ │ ├── characters/ # GET / POST characters (custom builder handler)
│ │ ├── chats/ # GET / POST chats, messages list, parameters tuning
│ │ │ ├── [id]/
│ │ │ │ └── messages/ # GET / POST messages for a specific chat
│ │ │ └── route.js
│ │ ├── images/ # Upload/CDN helpers for avatars
│ │ ├── stripe/ # Checkout session creation & payment webhooks
│ │ └── upload/ # File uploading helper endpoint
│ ├── components/
│ │ └── Providers.jsx # NextAuth SessionProvider wrapper
│ └── lib/
│ ├── auth.js # NextAuth configuration with Google OAuth and Prisma adapter
│ └── prisma.js # Global PrismaClient singleton with PG adapter
└── next.config.mjs # Next.js configuration
MIT Licensed.
14 commits
4 commits
JavaScript
97.9%
CSS
2.0%