Download
Course code package
Learners with full course access can download a zip of every Python and TypeScript sample from the lessons. This page is the map of that zip: layout, env scripts, and which API key unlocks which samples.
Download from Learning (full unlock) or from a lesson’s code panel. The tutor on the site uses Vercel AI Gateway separately; the zip is for running samples on your machine.
What’s in the zip
README.md— setup and how to run a sample.env.example— one Anthropic, OpenAI, or AI Gateway keyscripts/env.pyandscripts/env.mjs—generateandcheckpython/—requirements.txt,course_env.py, then one folder per lesson idtypescript/—package.json,course-env.ts, then the same lesson folders- YAML and other non-code snippets sit next to the lesson id at the zip root
Env: generate and check
Fill in one API key in .env. If more than one is set, also set LLM_PROVIDER to anthropic, openai, or gateway.
python3 scripts/env.py generate python3 scripts/env.py check # or: node scripts/env.mjs generate && node scripts/env.mjs check
generate creates .env from the example when needed, picks the provider from the filled key (or from LLM_PROVIDER), and writes the derived block: LLM_PROVIDER, MODEL, FALLBACK_MODEL, and gateway base URLs when the provider is gateway. It does not overwrite the key you typed.
check parses .env, confirms the selected key and MODEL, and prints which sample groups that key unlocks.
Which key runs what
| Key | Samples |
|---|---|
ANTHROPIC_API_KEY | Anthropic Messages lessons, LangChain / Pydantic AI, raw HTTP lab, Claude Agent SDK, Vercel AI SDK (Anthropic) |
OPENAI_API_KEY | OpenAI Agents SDK and OpenAI-shaped samples. Anthropic Messages samples ask you to switch key. |
AI_GATEWAY_API_KEY | Same Anthropic- and OpenAI-shaped samples through https://ai-gateway.vercel.sh. Model ids look like anthropic/claude-sonnet-4-5. |
Shared client helpers
Samples do not hardcode provider clients. They import course_env (Python) or course-env.ts (TypeScript), which read LLM_PROVIDER and MODEL from the environment.
- Python: run with
PYTHONPATH=pythonsoimport course_envresolves - TypeScript: from a lesson folder,
import { ... } from "../course-env.ts" anthropic_client()/anthropicClient()for Messages API samplesmessages_http()/messagesHttp()for the Week 1 raw HTTP labensure_openai_env()/ensureOpenAIEnv()before OpenAI Agents SDK samples when using the gateway
Run a sample
After generate, check, and installing dependencies:
set -a && source .env && set +a PYTHONPATH=python python python/w1-tokens/count_tokens_and_price_a_call.py # from typescript/ node --env-file=../.env --import tsx w1-tokens/count_tokens_and_price_a_call.ts
From typescript/ you can also run npm run env:generate and npm run env:check.
How the zip is built
The site builds the zip at request time from the lesson markdown in agentic-ai-course/, plus the static helpers under course-package/ (scripts/, python/course_env.py, typescript/course-env.ts). Code fences with a filename become files under python/<lesson-id>/ or typescript/<lesson-id>/.