A fully featured, open-source web UI for chatting with Claude via the Anthropic API. Designed for personal use with your own API key. Inspired by claude.ai, but enhanced with features like conversation saving, file attachments, token counting, and export/import support.
Built with Next.js 14 App Router, TypeScript, Tailwind CSS, and shadcn/ui.
- Streaming Responses using Server-Sent Events
- Conversation Management with auto-title, context trimming, and local persistence (via Prisma + SQLite)
- Token Counting with context usage breakdown and cost estimates
- Settings Panel to configure model, temperature, max tokens, and API key
- File Uploads (text, code, and images with content-aware formatting)
- Export Conversations as:
- Markdown (readable)
- JSON (structured)
- Compact AI format (optimized for continuation)
- Context Manager with auto-trim, usage alerts, and visual indicators
- Artifact Canvas for editing, copying, or downloading generated code
- Dark/Light Theme with local preference memory
- Next.js 14 (App Router)
- TypeScript
- Tailwind CSS + shadcn/ui
- Prisma with SQLite (default)
- Anthropic SDK for Claude API
- Lucide React Icons
- Monaco Editor for code blocks
git clone https://github.com/your-username/claude-api-chat.git
cd claude-api-chatpnpm install
# or
npm installCreate a .env.local file in the root directory:
ANTHROPIC_API_KEY=your_api_key_hereOr enter it manually in the Settings Panel at runtime.
npx prisma migrate dev --name initThis will create a SQLite DB in prisma/dev.db by default.
npm run devVisit http://localhost:3000 to start chatting.
app/— Main Next.js App Router layout & routescomponents/— Reusable UI components (markdown renderer, file upload, sidebar, etc.)lib/— Token utils, settings, export handlers, Prismahooks/— Custom React hooksprisma/— Prisma schema and migrationspublic/— Static assets
- This project does not sync with claude.ai — conversations are local.
- Anthropic’s API has no memory — all context must be sent with each call.
- You are responsible for managing your API token usage and costs.
MIT License. Use at your own risk. Not affiliated with Anthropic.