M00 — Setup & Three Clients
Three companies, three SDKs, one identical idea. In this module you'll install the Anthropic (Claude), Google (Gemini), and OpenAI (GPT) SDKs, get an API key for each, and send the exact same "Hello" to all three — so you can see, side by side, how alike they really are.
Learning Objectives
- Install and import all three official SDKs in Python and Node.js, and know the exact package names
- Get an API key from each provider and wire it in through the correct environment variableA named value your program reads from the operating system instead of hard-coding it in source. Keeps secrets like API keys out of your code and out of version control.
- Send an identical one-shot message through the Anthropic, Gemini, and OpenAI SDKs and read the reply
- Recognize the universal agent pipeline that every provider implements, just with different names
- Pick a sensible default model for each provider using the current model tables
- Meet Acme Support, the customer-service agent we'll grow across all eight modules
Why Learn Three SDKs at Once?
BEFORE: Imagine you learned to drive in exactly one car — a specific 2019 hatchback. You know that car: the wiper stalk is on the left, the fuel cap release is by the seat. You can drive it perfectly.
PAIN: Then you rent a different car on holiday and freeze. Where are the lights? Why won't it start? You never learned driving — you learned that one car. Every control felt load-bearing because you couldn't tell which parts were "driving" and which parts were "this particular dashboard."
MAPPING: Learning one AI SDK in isolation is the same trap. You memorize client.messages.create without knowing which parts are "how agents work" and which parts are "how Anthropic spells it." This course teaches you all three dashboards at once, so the shared steering wheel and pedals — prompt in, model thinks, tool runs, answer out — become obvious, and the branded knobs become interchangeable trivia.
In a real job you rarely get to pick just one. A cost review moves a workload from GPT to Gemini. A customer requires their data stay with Claude. A new model from any of the three suddenly wins on your benchmark. Teams that only know one SDK treat these as rewrites; teams that know the shared shape treat them as a config change. By module 8 you'll be in the second group.
The One Universal Idea
Before any code, hold this in your head: every one of these SDKs does the same four things. They only disagree on vocabulary.
- You send a conversation (a system instruction + the messages so far) to a model.
- The model replies — either with a final text answer, or with a request to call one of your toolsA function you expose to the model (get_order_status, search_products…). The model can't run it — it asks you to run it and hand the result back. You'll build your first tool in M01..
- If it asked for a tool, you run that function in your own code and append the result to the conversation.
- You loop back to step 1 until the model returns a final answer.
That four-step loop is an agent. Anthropic calls the tool request a tool_use block; Gemini calls it a function_call; OpenAI calls it a function_call item too. Same idea, three labels. The animation below runs one request through all three pipelines at once — watch the identical stages light up in each column.
Every row lit up in every column at the same time, because it's the same row. Once you see that the pipeline is shared, the rest of this course is just learning three dialects of one language. This module covers stages you can see today (send & final answer); M01 adds the tool round-trip in the middle.
Get Your API Keys
Each provider gives you a secret key. You'll paste each into an environment variable so it never touches your source code. Grab all three now — the free tiers are enough for this whole course.
Anthropic (Claude)
Sign up at console.anthropic.com → API Keys → Create Key.
Env var: ANTHROPIC_API_KEY
Key looks like sk-ant-...
Google (Gemini)
Get a key at aistudio.google.com/apikey (Google AI Studio).
Env var: GEMINI_API_KEY
Key looks like AIza...
OpenAI (GPT)
Sign up at platform.openai.com → API keys → Create.
Env var: OPENAI_API_KEY
Key looks like sk-proj-...
SET THEMExport all three in your shell (or put them in a .env file). Every SDK below reads its key from these variables automatically — you never pass the key in code.
export ANTHROPIC_API_KEY="sk-ant-..."
export GEMINI_API_KEY="AIza..."
export OPENAI_API_KEY="sk-proj-..."
$env:ANTHROPIC_API_KEY = "sk-ant-..."
$env:GEMINI_API_KEY = "AIza..."
$env:OPENAI_API_KEY = "sk-proj-..."
A leaked key can run up real charges on someone else's card — your card. Never hard-code a key in source, never paste one into a chat or screenshot, and add .env to your .gitignore. Every example in this course reads keys from the environment for exactly this reason.
Install the Three SDKs
All three ship official, first-party SDKs for both Python and Node.js. One install line per ecosystem covers the whole course.
pip install anthropic google-genai openai
npm install @anthropic-ai/sdk @google/genai openai
- Anthropic:
anthropic(Python) ·@anthropic-ai/sdk(Node) - Google Gemini:
google-genai(Python) ·@google/genai(Node). Not the oldgoogle-generativeai/@google/generative-ai— those are the deprecated pre-2025 packages. - OpenAI:
openaifor both.
Google has two Python packages with confusingly similar names. The current, GA one is google-genai (imported as from google import genai). The older google-generativeai (imported as import google.generativeai) is superseded. If a tutorial imports google.generativeai, it predates mid-2025 — use the new SDK shown here instead.
Your First Call — "Hello, Acme"
Time to send the same message to all three. Each snippet creates a client (which auto-reads its API key from the environment), sets a system instruction turning the model into our support agent, sends one user message, and prints the reply. Flip through the six tabs — notice how little actually differs.
# hello_anthropic.py
from anthropic import Anthropic
client = Anthropic() # reads ANTHROPIC_API_KEY from the environment
resp = client.messages.create(
model="claude-sonnet-5",
max_tokens=300,
system="You are Acme Support, a warm, concise e-commerce help agent.",
messages=[{"role": "user", "content": "Hi! Is my order on its way?"}],
)
# The reply is a list of content blocks; the first text block is the answer.
print(resp.content[0].text)
// hello_anthropic.mjs
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic(); // reads ANTHROPIC_API_KEY
const resp = await client.messages.create({
model: "claude-sonnet-5",
max_tokens: 300,
system: "You are Acme Support, a warm, concise e-commerce help agent.",
messages: [{ role: "user", content: "Hi! Is my order on its way?" }],
});
const first = resp.content[0];
console.log(first.type === "text" ? first.text : "");
# hello_gemini.py
from google import genai
from google.genai import types
client = genai.Client() # reads GEMINI_API_KEY from the environment
resp = client.models.generate_content(
model="gemini-2.5-flash",
config=types.GenerateContentConfig(
system_instruction="You are Acme Support, a warm, concise e-commerce help agent.",
),
contents="Hi! Is my order on its way?",
)
print(resp.text)
// hello_gemini.mjs
import { GoogleGenAI } from "@google/genai";
const ai = new GoogleGenAI({}); // reads GEMINI_API_KEY
const resp = await ai.models.generateContent({
model: "gemini-2.5-flash",
config: {
systemInstruction: "You are Acme Support, a warm, concise e-commerce help agent.",
},
contents: "Hi! Is my order on its way?",
});
console.log(resp.text);
# hello_openai.py (Responses API — OpenAI's recommended default for agents)
from openai import OpenAI
client = OpenAI() # reads OPENAI_API_KEY from the environment
resp = client.responses.create(
model="gpt-5.5",
instructions="You are Acme Support, a warm, concise e-commerce help agent.",
input="Hi! Is my order on its way?",
)
print(resp.output_text)
// hello_openai.mjs (Responses API)
import OpenAI from "openai";
const client = new OpenAI(); // reads OPENAI_API_KEY
const resp = await client.responses.create({
model: "gpt-5.5",
instructions: "You are Acme Support, a warm, concise e-commerce help agent.",
input: "Hi! Is my order on its way?",
});
console.log(resp.output_text);
Hi there! I'd be happy to check on your order. Could you share your order number (it starts with "AC-")? Once I have it I can tell you exactly where your package is and when it'll arrive.
All six snippets do the identical thing. Line them up and only three things move:
- The client name:
Anthropic()vsgenai.Client()vsOpenAI(). - Where the system prompt goes: a top-level
system=(Anthropic), insideconfigassystem_instruction(Gemini), or asinstructions=(OpenAI). - How you read the reply:
resp.content[0].text(Anthropic returns a list of blocks),resp.text(Gemini), orresp.output_text(OpenAI). Anthropic hands back a list of content blocks because a single reply can mix text, tool calls, and thinking — you'll lean on that in M01.
OpenAI's SDK exposes two ways to call a model. This course leads with the newer Responses API (client.responses.create) because OpenAI recommends it for agentic work and its tool loop lines up cleanly with the other two providers. You'll also meet the older, extremely common Chat Completions API (client.chat.completions.create, using a messages=[...] array). Here's the same hello in Chat Completions so you recognize it in the wild:
resp = client.chat.completions.create(
model="gpt-5.5",
messages=[
{"role": "developer", "content": "You are Acme Support, a warm, concise help agent."},
{"role": "user", "content": "Hi! Is my order on its way?"},
],
)
print(resp.choices[0].message.content)
Note the developer role — on current OpenAI models it replaces the old system role in Chat Completions.
These hello snippets are kept bare so the shape is obvious. Real code wraps calls in try/except (network errors, rate limits, refusals) — every SDK ships typed exceptions and automatic retries. We add production-grade error handling starting in M01's tool loop and cover it fully in M07.
Which Model Should I Use?
Each provider offers a ladder of models trading capability against speed and cost. For this course we default to a balanced mid-tier from each. Here are the current options and our picks.
Anthropic (Claude)
claude-opus-4-8 — most capable
claude-sonnet-5 — our default, balanced
claude-haiku-4-5 — fastest, cheapest
Google (Gemini)
gemini-3.5-flash — newest flagship flash
gemini-2.5-pro — deepest reasoning
gemini-2.5-flash — our default, balanced
gemini-2.5-flash-lite — cheapest
OpenAI (GPT)
gpt-5.5 — our default, flagship
gpt-5.5-pro — most precise
gpt-5.4-mini — agent workhorse, cheap
gpt-5.4-nano — cheapest, high volume
New model names ship every few months and old ones retire. The IDs above are current as of this writing, but always check each provider's models page before a production launch. A floating alias like gemini-2.5-flash tracks the latest snapshot; pin a dated snapshot (e.g. gpt-5.5-2026-04-23) when you need byte-for-byte reproducibility.
Meet Acme Support
Rather than a throwaway "weather bot," we'll build one realistic agent and grow it across the whole course: Acme Support, the customer-service assistant for a fictional online store. Every module adds one real capability to it — and builds that capability three ways.
| Module | Capability Acme gains | Concept you learn |
|---|---|---|
| M00 (here) | Says hello, three ways | Clients, keys, models |
| M01 | get_order_status tool | The tool-use loop |
| M02 | Returns a typed OrderStatus | Structured output |
| M03 | search_products + process_refund | Multi-tool orchestration |
| M04 | Remembers the customer across turns | Memory & conversation state |
| M05 | Answers from the help-doc knowledge base | RAG / retrieval grounding |
| M06 | Routes to Orders / Refunds specialists | Multi-agent systems |
| M07 | Streams, retries, and ships | Production hardening |
Customer support hits every agent concept naturally: it needs tools (look up an order), structure (return clean data to a UI), memory (who am I talking to?), retrieval (what does the returns policy say?), and routing (send billing questions to the billing specialist). One familiar scenario, every technique — so you're always learning the concept, never decoding a contrived example.
Three Ways, One Idea
Every module ends with this table: the same idea, mapped across the three SDKs' vocabulary. Here's the M00 version — the basics of talking to a model.
| Concept | Anthropic | Google Gemini | OpenAI |
|---|---|---|---|
| Python package | anthropic | google-genai | openai |
| Node package | @anthropic-ai/sdk | @google/genai | openai |
| Key env var | ANTHROPIC_API_KEY | GEMINI_API_KEY | OPENAI_API_KEY |
| Create client | Anthropic() | genai.Client() | OpenAI() |
| Send a message | messages.create() | models.generate_content() | responses.create() |
| System prompt | system= | config.system_instruction | instructions= |
| User input field | messages=[…] | contents= | input= |
| Read the reply | resp.content[0].text | resp.text | resp.output_text |
| Our default model | claude-sonnet-5 | gemini-2.5-flash | gpt-5.5 |
Anthropic returns a list of content blocks because Claude replies can interleave text, tool calls, and reasoning — so content[0].text reflects that structure. Gemini's contents/text naming comes from its "multimodal parts" model, where text is just one kind of part. OpenAI's input/output_text is the newer Responses API vocabulary designed around agent loops. None is more correct — they're three teams naming the same pipeline. Learn the shape, translate the nouns.
Knowledge Check
Q1: Which is the current, correct Python package for the Gemini SDK?
google-generativeaigeminigoogle-genai@google/genaigoogle-genai is the current unified SDK (from google import genai). google-generativeai is the deprecated pre-2025 package, and @google/genai is the Node package, not Python.Q2: Where does the system prompt go in each SDK?
system= parametersystem=, Gemini config.system_instruction, OpenAI instructions=user messageQ3: Why does Anthropic return resp.content[0].text instead of just resp.text?
Q4: You leave your key in OPENAI_API_KEY but call the OpenAI client and get an authentication error. Most likely cause?
ANTHROPIC_API_KEY.env file and a loader). A wrong model name gives a different error, not an auth error.Q5: OpenAI's SDK exposes two APIs. Which does this course lead with for agents, and why?
function_call / function_call_output loop lines up cleanly with Anthropic and Gemini — making the three-way comparison crisp.Module Summary
Key Takeaways
- Three packages, one shape.
anthropic/google-genai/openaiin Python;@anthropic-ai/sdk/@google/genai/openaiin Node. - Keys live in the environment —
ANTHROPIC_API_KEY,GEMINI_API_KEY,OPENAI_API_KEY— never in source. - The same "hello" is three tiny variations: client name, where the system prompt goes, and how you read the reply.
- Every SDK implements the same four-step agent pipeline. The rest of the course fills in the tool round-trip in the middle.
- Acme Support is our running example — one agent, grown three ways, eight modules deep.
Next: M01 — The Agent Loop & Tool Use
Right now Acme can only talk. In M01 you give it its first real power: a get_order_status tool it can call to look up a live order. You'll write the tool-use loop by hand in all three SDKs — and see that tool_use, function_call, and function_call are the same handshake wearing three name tags.