SIGNAL GRID ACADEMY
All courses

Bots & agents · Intermediate

Build Your First AI Bots

Make a Telegram assistant and a scheduled 'AI teammate' that does real work every day.

4 lessons 62 min Certificate
Steps for
Join free to track progress

Lesson 1 · 15 min · Windows

Your first Claude API call

A bot is just a program that sends a prompt to Claude and does something with the reply.

Install Python and the SDK

Windows steps
powershell
winget install Python.Python.3.12
py -m pip install anthropic

Store your key (never in code)

Windows steps
powershell
setx ANTHROPIC_API_KEY "sk-ant-...your key..."

Close and reopen PowerShell so it takes effect.

hello_bot.py

python
import anthropic

client = anthropic.Anthropic()  # reads ANTHROPIC_API_KEY
reply = client.messages.create(
    model="claude-haiku-5-5",
    max_tokens=300,
    system="You are a friendly assistant. Answer in 3 short sentences.",
    messages=[{"role": "user", "content": "Give me one tip to save time at work."}],
)
print(reply.content[0].text)

Run it: py hello_bot.py (Windows) or python3 hello_bot.py (Mac/Linux).

Cost tip: set max_tokens low and use Haiku for simple jobs. Add a monthly spend limit in the Anthropic Console.

Quick quiz

Pass 2 of 3
1. Where should your API key live?
2. Which setting caps how long (and costly) a reply can be?
3. Best model for a cheap, simple bot?
Join free to take the quiz

Quick assignment

To do

Run hello_bot.py, change the system prompt to give it a personality, and paste the reply you got.

Hint: Never paste your API key.

Join free to submit

Stuck or proud of what you built? Discuss this course in the forum.