Skip to content
masterclass Buddy

FastAPI · Concept

Dependency injection

FastAPI dependencies let a path operation declare reusable logic it needs. FastAPI runs the dependency, reads its inputs, and injects its result into the operation.

Last updated

Syntax

Annotated[Type, Depends(callable)]

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • Depends
  • Security
  • Sub-dependencies
  • Classes as Dependencies
  • Dependencies in path operation decorators
  • Global Dependencies
  • Dependencies with yield

Source: Dependencies - FastAPI. Checked 2026-11-03.