Lesson 3 — Building the Chat UI
Create a file called chatbot.html. This single file will be your entire chatbot — UI, logic, and API connection all in one.
Lesson 3 — Building the Chat UI
Create a file called `chatbot.html`. This single file will be your entire chatbot — UI, logic, and API connection all in one.
Ask Claude to generate it for you with this prompt:
Build a single-file HTML chatbot UI that connects to the Anthropic Claude API.
Requirements:
API setup:
System prompt to start with:
"You are a friendly and knowledgeable AI assistant. You give concise, helpful answers.
You're warm, direct, and occasionally clever. Never use filler phrases like
'Great question!' or 'Certainly!'. Just answer."
Style the interface like a premium product — not like a default browser form.
You'll get a complete, working chatbot in one file. Open it in your browser and it works immediately (after you paste in your API key).