Chat · API · CLI · Code & Agents — four doors into the same building.
AI for Dummies Module 3
The AI model doesn’t change. How you reach it does — and that choice changes everything about what you can accomplish.
By the end of this lesson you’ll know which door to open for any task — and why beginners should start at the front door and work outward.
All four paths reach the same AI model. The door you pick determines who drives.
Same expert. Same intelligence. The door you pick determines who drives: you by hand, your code automatically, a local tool privately, or an agent acting on your behalf.
ollama run llama3.2 and a local AI model opens right there — no browser, no internet after the download, fully private. Looks scary; it’s just typing.
☝ Click a card above to see details
What Claude.ai looks like:
What you can do right now:
The limit: one exchange at a time. Repeat the same thing 300 times? That’s the API’s job, not Chat’s.
Rule: Start here. Stay here until Chat can’t do what you need. Most people never need to leave.
Watch how a follow-up message refines the answer without starting over.
The Chat superpower: you refine, you don’t restart. “Shorter,” “more formal,” “add examples” — each follow-up builds on context the model already has.
API = Application Programming Interface. Instead of you typing, your code sends the message and handles the reply — automatically, in a loop, at any scale.
Chat = dining room. You sit down, the waiter takes one order, brings it back.
API = kitchen window. You slide structured tickets through. Thousands of tickets. Structured responses back. No waiter needed.
Same chef, same food — different doorway.
📊 You have 800 customer reviews and want a one-sentence sentiment tag on each.
Copy-pasting 800 times isn’t a plan. A 10-line Python script that loops over your spreadsheet: that’s the API.
🏗️ You’re building an app with an AI-powered feature.
The app calls the API on behalf of every user. That’s how every AI-powered product in the world is built.
⏰ You want AI to run on a schedule — every morning, process last night’s data automatically.
Script + scheduler + API = fully automated pipeline. No human clicking required.
Rule of thumb: if you’d need to type the same prompt more than a handful of times, the API removes all the repetition.
This is the actual Anthropic API call, straight from the documentation. Every library wraps exactly this.
Wrap this in a for loop → process your entire spreadsheet automatically.
curl https://api.anthropic.com/v1/messages \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{
"model": "claude-sonnet-4-6",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Explain what an API is in one sentence."}]
}'
Install once, then call Claude from any Python script. This is a complete, working program.
# Install the library (one-time)
pip install anthropic
import anthropic
client = anthropic.Anthropic()
# reads ANTHROPIC_API_KEY from env
message = client.messages.create(
model="claude-sonnet-4-6",
max_tokens=1024,
messages=[{
"role": "user",
"content": "Write a 2-line welcome email."
}]
)
print(message.content[0].text)
What each part does:
Anthropic() — connects using your env keymodel= — pick Haiku (cheap), Sonnet, or Opusmax_tokens — cap the length of the replymessages= — the conversation so far.content[0].text — the text of the replyWrap client.messages.create() in a for row in csv: loop and you’ve just automated your entire spreadsheet.
An API key is a long secret string. Every call made with it is billed to your account — even if someone else makes the call.
os.environ["ANTHROPIC_API_KEY"]Leaked keys are used by strangers and run up real bills. It happens to beginners constantly — paste key into tutorial, push to GitHub, get charged $300. Set the spending limit first. It’s the one safety net that stops the damage.
The terminal is a text window where you type commands. It looks scary. It’s just… typing.
That’s a real CLI session. Fully offline, zero cost after download, 100% private.
CLI is great for: local AI tools (Ollama, LM Studio CLI), running scripts, servers with no GUI, developer automation workflows.
Useful Ollama commands:
ollama list # installed models
ollama pull mistral # download model
ollama serve # run as a server
Gentle CLI intro comes in Lesson 04 when we install Ollama. You don’t need to touch it today.
Chat answers. An agent executes. Give it a goal and step through how it works.
Your instruction: “Fix the bug in auth.py and make sure the tests still pass.”
CHAT — you steer every step
AGENT — you set the goal
Key difference: Chat gives you advice. An agent takes action. That power comes with a responsibility: always review what the agent proposes before it changes real files.
Claude Code is Anthropic’s coding agent. It runs in your terminal, reads your project, and edits files. Here’s what a session looks like:
tmp to temp_buffer in the project.
tmptemp_buffer = []temp_buffer = dataYou need: a paid Claude plan or API key. Install: npm install -g @anthropic-ai/claude-code or curl -fsSL https://claude.ai/install.sh | bash
Safety rule: always run Claude Code on version-controlled code. Read what it proposes before approving. It can and will change real files.
| Doorway | Skill needed | Install? | Best for | Cost | Privacy |
|---|---|---|---|---|---|
| 💬 Chat | None | No | Questions, writing, learning | Free tier | Cloud |
| 🔌 API | A little coding | pip install | Automation, apps, batches | Per token | Cloud |
| ⌨️ CLI | Typing commands | Yes (Ollama) | Local tools, scripts, servers | Free | Local |
| 🤖 Agent | Tech-comfortable | Yes | Coding, multi-step file tasks | Per token | Cloud |
Pick the doorway by what you need, not by what sounds most impressive. Chat solves roughly 80% of everyday problems and needs zero setup.
Cloud API costs money per token. Local models (Ollama) are free per call after setup. Here’s what 10,000 short calls looks like:
~50 input + 50 output tokens per call. Prices illustrative — check provider docs for current rates.
Cloud: best quality, easiest setup, pay per use. Data leaves your machine. Ideal for most tasks.
Local: free per call, fully private, works offline. Needs decent hardware (16 GB RAM recommended). Perfect for sensitive data or high volume.
Week 1–2: Chat only. Use Claude.ai for real daily tasks. Learn how to ask well, how to follow up, and when to verify answers.
🔁 “I need this 500 times”
→ Move to API
📂 “I want it to edit my files”
→ Move to Code / Agents
🔒 “I need total privacy / offline”
→ Install Ollama & use the CLI
ollama run llama3.2 for a local, free, private AI session.The expert in the building is the same regardless of which door you use. Pick based on what you need to do — not what sounds most technical.
🧪 This week’s action: open Claude.ai and use it for three real tasks you’d normally do yourself. Notice where it shines, where it needs guidance, where it gets things wrong.