
Explore six modules in prompt engineering with Python and the OpenAI API, from setup in JupyterLab to zero-shot, few-shot prompts, and advanced techniques like structured outputs and function calling.
Run the Setup Test notebook to verify Python version, required packages, and the Jupyter kernel, ensuring your environment is ready for OpenAI account setup and troubleshooting.
Master zero-shot and one-shot prompting in Python and the OpenAI API, learning the role, task, constraints, and format formula, and crafting prompts for sentiment analysis with consistent outputs.
Examine zero-shot, one-shot, and few-shot prompting with three to five examples, highlighting accuracy gains, diminishing returns, and the trade-off with token cost and edge-case handling.
Learn to obtain robust JSON from AI using structured outputs, validate and parse data into Python dictionaries, and apply few-shot prompting to produce consistent, nested JSON for production prompts.
Learn to define clear schemas and handle nested data in prompts using dictionaries and json.dumps, with examples of contact arrays and a nested product schema.
Explore robust error handling and retry logic for OpenAI API calls, including exponential backoff, retryable errors, and structured dictionary responses with validation and fallbacks.
Avoid hard-coding prompts by using a templates dictionary, a prompt class, and a prompt library for versioned, testable prompts.
Learn to evaluate prompts by testing and comparing outputs using a labeled text dataset in a notebook, measuring accuracy to choose baseline and improved prompts.
Explore instructions and conversation chaining to control behavior and maintain context across multi-turn chats using previous response IDs, with a reusable conversation manager that auto-applies instructions.
Explore few-shot advanced techniques for production tasks, including data extraction to structured JSON, style transfer, and combining shots with instructions, plus dynamic example selection and edge-case handling.
Explain self-consistency in prompt engineering by generating multiple responses, using majority vote for discrete answers, numerical consensus for math with normalization, and quality scoring for open-ended responses.
Create a production-ready research assistant by combining prompts, personas, and few-shot techniques into a four-phase pipeline that decomposes questions, synthesizes findings, and validates results.
Learn to count tokens and track costs using tick token, simulate tokenization locally, and compare input versus output prices across OpenAI models, then prepare for optimization in module 5b.
Explore context window strategies, including a sliding window and summarization, to manage local context, reduce costs, and use server-side context with previous response ID.
Learn to implement response caching to avoid duplicate API calls, caching by prompt, instructions, and model, using an MD5 key to store and retrieve responses.
Build a production support bot that enforces budgets, manages context with a sliding window, and caches responses to handle duplicates.
Learn function calling with the OpenAI API, define tools schemas, handle function calls and outputs, and scale by mapping function names to Python functions for tasks like weather.
Define and route multiple functions—get weather, get user info, and calculate—using a combined tools list, then execute sequential or parallel calls with a function assistant class.
The API is where real applications are built. This course is how you get there.
This course is for developers who are ready to move from experimenting with AI to actually building with it. You'll work directly with OpenAI's modern Responses API — the one OpenAI recommends for all new projects — writing real code that connects to real tools and produces real results.
WHAT YOU'LL BUILD
You'll complete Three Capstone Projects, each one closing out a module after the concepts that make it possible have been taught.
Research Assistant — Decomposes complex questions into sub-questions, investigates each one independently, and synthesizes the findings into a structured answer. Built using instruction chaining, personas, and advanced few-shot techniques.
Production Support Bot — A fully functional support chatbot with budget controls, sliding window context management, and response caching. Built incrementally across two modules to show how production systems are actually assembled — not just demonstrated in a single notebook.
Multi-Tool Agent — Connects to a live weather API and queries a real SQLite database using function calling. This is AI that interacts with the outside world through Python functions.
WHAT YOU'LL LEARN
API Fundamentals — Connect to the OpenAI API, configure your environment, and make your first calls using the Responses API. Understand model selection, token usage, and cost tracking from day one.
Core Prompting — Zero-shot, one-shot, and few-shot prompting. Understand exactly how the model responds to different prompt structures and why it matters.
Production Prompting — Structured JSON outputs for reliable parsing, error handling with exponential backoff, reusable prompt templates, and systematic prompt evaluation so you can measure whether your prompts are actually working.
Advanced Prompting — Instruction chaining, role-based personas, advanced few-shot techniques, and self-consistency strategies for more reliable outputs.
Production Patterns — Token counting and cost tracking with tiktoken, context window strategies for long conversations, and response caching to eliminate redundant API calls.
Function Calling — The complete function calling workflow. Connect the AI to external tools, live APIs, and real databases so it can take actions in the world.
HOW THE COURSE IS STRUCTURED
Six modules. 25+ hands-on Jupyter notebooks. Each concept is taught in its own notebook with working code you can run, modify, and reuse. Each module closes with a capstone that puts everything you just learned into a real, deployable application.
PREREQUISITES
Basic Python familiarity — classes, functions, loops, and importing packages. Environment setup is covered in Module 1.
You'll also need an OpenAI account with a minimum of $5 in API credit. That's more than enough to complete every exercise in the course using gpt-5-mini, the default model used throughout.
WHO THIS COURSE IS FOR
Engineers adding AI capabilities to existing applications. Analysts automating workflows with Python. Technical leads evaluating how to integrate AI into their teams' work.
WHO THIS COURSE IS NOT FOR
Complete beginners to Python. If you're new to Python, build that foundation first — you'll get significantly more out of this course when you come back.