Build Your First AI Chatbot0% done
← PrevNext →
Lesson 3 of 6~1 min read

Lesson 2 — Getting Your API Key

You need an API key to talk to Claude programmatically (not through the chat website, but directly from your code).

Lesson 2 — Getting Your API Key

You need an API key to talk to Claude programmatically (not through the chat website, but directly from your code).

Steps:

  • Go to console.anthropic.com and create an account
  • Add a payment method (you get $5 free credit — more than enough to complete this course and experiment for weeks)
  • Go to "API Keys" and create a new key
  • Copy it somewhere safe — you won't see it again
  • **Important:** Never put your API key directly in HTML or JavaScript that gets pushed to GitHub. Anyone who sees the file can use your key and run up your bill. For this course we'll handle it safely.

    For local testing, you can put the key directly in your code. For deployment, you'll use environment variables (Vercel and Netlify both support this — it takes 30 seconds).

    ← PREVIOUSLesson 1 — How Chatbots Actually WorkNEXT →Lesson 3 — Building the Chat UI