Module 1 · Phase 1: Foundations from raw APIs · Weeks 1–2

LLM API Mastery

No frameworks. Raw HTTP/SDK calls only. Everything an agent does reduces to these mechanics: the message array, tool calling, structured outputs, thinking & effort, streaming, multimodal input, tokens, and robust error handling.

After this module you can
  • Explain and implement the chat message format (system/user/assistant/tool roles) from memory
  • Implement tool calling end-to-end: schema → model emits call → you execute → return result → model continues
  • Produce validated structured outputs with JSON schema and recover from malformed JSON
  • Stream responses token-by-token and explain why streaming matters for agent UX
  • Count tokens, estimate cost per call, and reason about context-window budgets
  • Handle rate limits, timeouts, and refusals with exponential backoff and graceful degradation
  • Enable adaptive thinking, tune effort, and explain why frontier models replaced sampling parameters
  • Send images and PDFs as content blocks and combine document input with structured outputs for extraction

Lessons

1
Setup: Keys, SDKs, and Your First Call
Ten minutes of environment work so every code snippet in this course actually runs: provider accounts, API keys, a Python virtualenv, both SDKs, and a smoke-test call to prove the plumbing before Lesson 1 assumes it.
15 min
2
Messages Are the Only State
The single most important fact in agent engineering: the model is stateless. A 'conversation' is you resending an ever-growing array. Every agent pattern you'll ever build follows from this.
35 min
3
Controlling Generation: Sampling, Thinking & Streaming
How a token actually gets picked, step by step — logits, softmax, and the sampling parameters that shape the draw — and how the dials changed. Classic sampling (temperature, top_p) still runs most of the industry, but 2026 frontier models replaced those knobs with adaptive thinking and an effort parameter. Streaming turns dead air into perceived speed.
38 min
4
Tool Calling End-to-End
The mechanism that turns a text generator into something that can act. Crucial mental model: the model never executes anything — it emits structured JSON, and your code does the work.
40 min
5
Structured Outputs & JSON Schema
When you need data, not prose: forcing model output to conform to a schema, and what to do when it doesn't.
30 min
6
Errors, Rate Limits & Cost Control
An agent lives or dies on the unhappy path. Rate limits, timeouts, overloaded servers, refusals, context overflows — production behavior is defined by how you handle these.
45 min
7
Beyond Text: Images, PDFs & Files
Real agent tasks aren't text-only: screenshots in bug reports, invoices as PDFs, documents to extract from. Multimodal input is just more content-block types in the same messages array.
25 min

Best external resources

Curated reading, docs, and tools that pair with this module.