Index Ai Academy
Glossary · Phase 8 · APIs

Lifespan

The part of a FastAPI app that runs once at startup and once at shutdown, where models and connections are set up.

Try it now

Pick each case in turn. The error cases leave early and the good one reaches the last gate, where the hash is dropped.

Learn it properly

APIs with FastAPI · Typed routes, pydantic models, automatic validation and docs, tested with httpx. About 45 minutes.

Other terms from the same lesson

  • pydantic: A Python library that checks data against a class with typed fields, converting values where it can and listing every problem it finds.
  • response model: In FastAPI, the class that describes a reply: only its fields are sent, so internal data such as password hashes can't leak out.
Keep learning

More in plain English.

1286 terms in the glossary, each with the lesson that teaches it.

1286 terms

The glossary

Every word you'll meet in AI and machine learning, explained in everyday language.

Phase 8 · lesson 45 min

APIs with FastAPI

Typed routes, pydantic models, automatic validation and docs, tested with httpx.

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