Free Python for AI course
Learn Python from your first line of code to your first call to a language model, with nothing to install.
Design, test, deploy, and operate an HTTP API that another engineer can use.
A request carries an operation, its inputs, and a caller identity. The API validates the contract and caller before work starts, then returns a result a separate client can interpret or retry.
A client sends CSV and an idempotency key with its authenticated request.
The API validates it and records one queued import for that caller and key.
The worker completes the job and the client looks up the same report.
A client sends CSV and an idempotency key with its authenticated request.
The API validates it and records one queued import for that caller and key.
The worker completes the job and the client looks up the same report.
Given A client sends CSV and an idempotency key with its authenticated request. and The worker completes the job and the client looks up the same report., write down the missing step that connects them.
The API validates it and records one queued import for that caller and key.
Now take The API validates it and records one queued import for that caller and key. and the result above. Write an input and an implementation that could produce this trace.
A client sends CSV and an idempotency key with its authenticated request.. Check that your implementation produces the result shown above.
The connection closes after the server commits the job. What should the client reuse on retry?
Send the same body, caller identity, and idempotency key. The server can return the existing job. A different body with that same key should surface a conflict.
Account A sends key 42. The API records job J; the reply is lost.
Account A sends the same data and key 42.
Account B sends the same data and key 42.
How many job records should exist? What two things should the contract test assert for Account A?
Two jobs should exist because the key belongs to each caller’s request scope. The retry from A returns a reference to J and never creates another A job. A can retrieve J without seeing B’s job.
Transport communicates intent and a result. The contract, caller scope, and durable operation identity determine whether a retry represents work already done.
The first submit stores a job but its HTTP response is lost. Trace a retry with the same key and payload, then a later request with the same key and changed payload.
Give a reviewer the OpenAPI contract, a running FastAPI service, and an independent TypeScript client. Show one job after the retry, a conflict for the changed payload, and a denied cross-caller read.
Deploy a backward-compatible field addition. Use the same client and a rollback rehearsal to show that both versions preserve the agreed behavior.
The import contract specifies an integer clicks count. Pass that contract into a function modeling the request-validation layer.
Run the starter, predict the changed result, and then edit and run it again.
Replace the string '12' with the integer 12. Check the client-visible status and the accepted value.
body = {"clicks": "12"}
value = body.get("clicks")
if type(value) is int:
print(f"202 | clicks={value}")
else:
print("422 | clicks must be an integer")Starter output
422 | clicks must be an integer
Changed output
202 | clicks=12
Coercing strings makes malformed clients look healthy and hides a contract mismatch. Return a clear error unless the contract explicitly allows coercion.
Take the changed output into the next lesson and explain which part of the handoff the next lesson needs.
Begin with How APIs work. Each lesson offers these practice modes and a saved handoff.
Use the campaign import service to practice an API contract, SQL-backed jobs, safe retries, and access checks.
Use the campaign service starter from Software Lab. Follow each stage, collect the evidence, then move to the independent brief.
HTTP, OpenAPI, FastAPI, SQL, authorization, retries, deployment, and rollback.
2 are free with no account, and a free account opens the rest.
Some lessons here build on earlier ones in the academy. The placement test can mark off what you already know, and you can open any of them first:
New to Python? Start with the free Python for AI course.
Finish every lesson and get staff approval on “Deploy a support import and reporting API” in My projects to earn the course certificate. The course ends with its own checkpoint, 12 questions the academy's server draws and marks itself. Pass it to verify the certificate and count lessons you skipped in the placement test.
Yes. There's nothing to pay, here or anywhere in the academy. A free account saves your progress and issues your certificate.
The lessons run in your browser. The downloadable service project uses a local Python environment.
About 16.5 hours in all, at your own pace. Your progress stays where you left it.
You completed the course and passed a staff-reviewed independent project, “Deploy a support import and reporting API”. See My projects for the brief, evidence requirements, and submission.
Or take the whole course: 575 lessons, from your first line of Python to production AI.
Learn Python from your first line of code to your first call to a language model, with nothing to install.
Learn to write prompts that work reliably, then test them like an engineer: clear instructions, examples, structured output, chains, evals and defenses against prompt injection.
Build retrieval-augmented generation step by step: embeddings, chunking, vector search, grounded answers with sources, and the measurements that tell you whether it works.
Learn how to build AI agents by building one: tools, the agent loop, MCP, permissions, context management and evals, ending with a coding agent that stops when its tests pass.
Go from counting letter pairs to a small GPT you train yourself: tokenizers, attention, transformer blocks and the GPT architecture, written line by line.
Go from your first line of code to working as a Python developer: projects, testing, data, databases, web apps and APIs, all in your browser.
Follow one prompt, "The cat sat", through a language model with every number shown: tokens to IDs, embeddings and positional waves, the attention matrix, the feed-forward layer, and the probability over the next word.
Confident wrong answers, miscounted letters, copying from the prompt, temperature, long prompts that dilute, and a model that never says "I don't know": each behavior reproduced on a tiny GPT with every number printed by code, then the mechanism behind it and the Phase 1 technique it justifies.
Read a model's weights, change them by hand and judge an edit someone else made: deltas, merging, low-rank edits, directions and fact edits on a tiny GPT in your browser. Then replay recorded sessions of an LLM reading, fixing and writing weights, check the published edit of a real open model, and ship a model of your own with its patch, verdict and card. Every number is printed by the lesson's own code, and the method's limits are taught with it.
Take a model from a notebook to a system that stays right: track and reproduce every run, search settings honestly, version data and models, promote through gates, keep training and serving in step, choose batch or online, catch drift, and retrain through a pipeline. Every number is measured by the lesson's own code.
Learn the math behind AI from arithmetic up: numbers, algebra, vectors and matrices, calculus, probability and statistics, each shown as numbers moving and checked in Python, ending with a network you build and train from the formulas.
Learn to make any letter of any formula the subject: layers undone in reverse order, fractions, a letter that appears twice, powers, roots, quadratics, logs, inequalities, trigonometry, vectors, matrices, calculus, probability, statistics and the formulas inside AI models, each checked in Python.
Build a Model Context Protocol client and server, then verify the integration with a compatible host.
Build a bounded run loop, test it with scripted model responses, and recover interrupted work from an event log.
Never trained an AI? Teach a small one to write, right in your browser. It takes about 20 seconds and needs no account. Teach it to write
A free account saves your progress across devices and issues your certificate when you finish.