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?

Everyday Analogy

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.

Why It Matters

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.

Technical Definition — The Agent Pipeline
  1. You send a conversation (a system instruction + the messages so far) to a model.
  2. 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..
  3. If it asked for a tool, you run that function in your own code and append the result to the conversation.
  4. 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.

The Universal Agent Pipeline — Same Shape, Three Vocabularies
Anthropic
You sendmessages=[…]
Model asks for a toolstop_reason: "tool_use"
You return the resultrole:"user" + tool_result
Final answerstop_reason: "end_turn"
Google Gemini
You sendcontents=[…]
Model asks for a toolresponse.function_calls
You return the resultrole:"tool" + functionResponse
Final answerresponse.text
OpenAI
You sendinput=[…]
Model asks for a tooloutput: function_call
You return the resultfunction_call_output
Final answerresponse.output_text
What Just Happened?

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.comAPI KeysCreate 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.comAPI keysCreate.

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.

bash — macOS / Linux
export ANTHROPIC_API_KEY="sk-ant-..."
export GEMINI_API_KEY="AIza..."
export OPENAI_API_KEY="sk-proj-..."
PowerShell — Windows
$env:ANTHROPIC_API_KEY = "sk-ant-..."
$env:GEMINI_API_KEY   = "AIza..."
$env:OPENAI_API_KEY   = "sk-proj-..."
Security — Never Commit Keys

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.

Python (3.9+)
pip install anthropic google-genai openai
Node.js (18+) — ES modules
npm install @anthropic-ai/sdk @google/genai openai
The Package Names (memorize these three pairs)
  • Anthropic: anthropic (Python) · @anthropic-ai/sdk (Node)
  • Google Gemini: google-genai (Python) · @google/genai (Node). Not the old google-generativeai / @google/generative-ai — those are the deprecated pre-2025 packages.
  • OpenAI: openai for both.
Common Gotcha — Google's Two Packages

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);
Expected output (wording will vary — it's a language model)
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.
What Just Happened? — Spot the Three Differences

All six snippets do the identical thing. Line them up and only three things move:

  1. The client name: Anthropic() vs genai.Client() vs OpenAI().
  2. Where the system prompt goes: a top-level system= (Anthropic), inside config as system_instruction (Gemini), or as instructions= (OpenAI).
  3. How you read the reply: resp.content[0].text (Anthropic returns a list of blocks), resp.text (Gemini), or resp.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.
One Note on OpenAI — Two APIs, One SDK

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:

python — OpenAI Chat Completions (the alternative)
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.

About Error Handling

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.

✅ Checkpoint: Run all three (or all six). If each prints a friendly reply asking for your order number, your keys and installs are correct and you're ready for M01. If you get an auth error, re-check the matching environment variable is exported in the same shell you're running from.

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-5our 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-flashour default, balanced

gemini-2.5-flash-lite — cheapest

OpenAI (GPT)

gpt-5.5our default, flagship

gpt-5.5-pro — most precise

gpt-5.4-mini — agent workhorse, cheap

gpt-5.4-nano — cheapest, high volume

Model IDs Move Fast

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.

ModuleCapability Acme gainsConcept you learn
M00 (here)Says hello, three waysClients, keys, models
M01get_order_status toolThe tool-use loop
M02Returns a typed OrderStatusStructured output
M03search_products + process_refundMulti-tool orchestration
M04Remembers the customer across turnsMemory & conversation state
M05Answers from the help-doc knowledge baseRAG / retrieval grounding
M06Routes to Orders / Refunds specialistsMulti-agent systems
M07Streams, retries, and shipsProduction hardening
Why a Support Agent?

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.

ConceptAnthropicGoogle GeminiOpenAI
Python packageanthropicgoogle-genaiopenai
Node package@anthropic-ai/sdk@google/genaiopenai
Key env varANTHROPIC_API_KEYGEMINI_API_KEYOPENAI_API_KEY
Create clientAnthropic()genai.Client()OpenAI()
Send a messagemessages.create()models.generate_content()responses.create()
System promptsystem=config.system_instructioninstructions=
User input fieldmessages=[…]contents=input=
Read the replyresp.content[0].textresp.textresp.output_text
Our default modelclaude-sonnet-5gemini-2.5-flashgpt-5.5
Why the Differences? (a two-minute mental model)

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?

Agoogle-generativeai
Bgemini
Cgoogle-genai
D@google/genai
Correct! google-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?

AAll three use a top-level system= parameter
BAnthropic system=, Gemini config.system_instruction, OpenAI instructions=
CAll three put it as the first user message
DNone of them support system prompts
Correct! Same idea, three spellings — this is exactly the "learn the shape, translate the nouns" pattern the module is built around.

Q3: Why does Anthropic return resp.content[0].text instead of just resp.text?

AIt's a bug in the SDK
BBecause Claude is slower than the others
CBecause you must always send exactly one message
DA reply is a list of content blocks — text, tool calls, or thinking can be interleaved
Correct! That block structure is why Claude can return text and a tool request in one response — you'll use it directly in M01's tool loop.

Q4: You leave your key in OPENAI_API_KEY but call the OpenAI client and get an authentication error. Most likely cause?

AThe variable was exported in a different shell than the one running the script
BOpenAI doesn't support environment variables
CYou must also set ANTHROPIC_API_KEY
DThe model name is wrong
Correct! Environment variables are per-shell. Export it in the same terminal you run from (or use a .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?

AChat Completions, because it's the only one that supports tools
BThe Responses API, because OpenAI recommends it for agentic work and its tool loop mirrors the other two SDKs
CNeither — you must use the Agents SDK from the start
DChat Completions, because Responses is deprecated
Correct! Both APIs support tools and both are supported, but the Responses API's 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 / openai in Python; @anthropic-ai/sdk / @google/genai / openai in Node.
  • Keys live in the environmentANTHROPIC_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.