I'll build an AI chat app using Puter.js. Let me first research the Puter.js documentation to understand the API.
Let me get more details on the AI chat API and list models:
Let me fetch the chat API doc properly:
I have all I need. Now let me check the existing project files and start building:
Now let me build the app. I'll update the HTML to include the Puter.js script and the title, then create the chat app.
Now let me create a small markdown renderer, storage helpers, and the main App:
Now let me create the sidebar, chat components, and the main App:
Now the main App:
Let me fix that unused function:
Now let me build to check for errors:
The build succeeded. Let me also remove the unused Conversation type import since it's no longer used in App.tsx:
Conversation is used at line 19 — it's fine. Build succeeded with no errors. Here's a summary of what I built:
🎉 Puter AI Chat App
I built a full-featured AI chat app powered by Puter.js (500+ models, no API keys needed).
Features
- 500+ AI models – Chat with GPT-5, Claude Opus/Sonnet, Gemini, DeepSeek, Mistral, Grok, and more through Puter.js
- Streaming responses with a stop button and animated typing cursor
- Model picker – curated dropdown with search, plus the ability to type any custom model ID
- Multi-conversation sidebar – auto-titled from your first message, sorted by recency, individually deletable, with "clear all"
- Persistent history – conversations & active chat stored in
localStorage
- Markdown rendering – custom lightweight renderer with headings, bold/italic, links, lists, blockquotes, inline code, and fenced code blocks with per-block copy buttons and language labels
- Copy message buttons on both AI replies and code blocks
- Welcome screen with 4 example prompts on empty conversations
- Responsive design – slide-out sidebar on mobile with backdrop, sticky composer/header
- Auto-resizing textarea with Enter to send, Shift+Enter for newline
- Connection status indicator showing when Puter.js is loaded
- Error handling with retryable, styled error bubbles
- Dark theme with animated gradient background accents (violet/fuchsia/indigo)
- "Powered by Puter" attribution link in the sidebar and composer footer, as required by Puter.js docs
Architecture
index.html — loads https://js.puter.com/v2/ script
src/App.tsx — state management, conversation logic, streaming loop
src/components/ — Sidebar, ModelPicker, ChatMessage, Composer, Welcome
src/markdown.tsx — self-contained markdown-to-JSX renderer
src/storage.ts — localStorage persistence
src/models.ts — curated model list & system prompt
The build passes cleanly. Users can just open the app and start chatting immediately — no sign-up, no keys.
Files built: index.html, src/types.ts, src/models.ts, src/markdown.tsx, src/storage.ts, src/components/Sidebar.tsx, src/components/ModelPicker.tsx, src/components/ChatMessage.tsx, src/components/Composer.tsx, src/components/Welcome.tsx, src/App.tsx