As **FastAPI** is based on Starlette and implements the <abbrtitle="Asynchronous Server Gateway Interface">ASGI</abbr> specification, you can use any ASGI middleware.
As **FastAPI** is based on [Starlette](https://www.starlette.io/) and implements the <abbrtitle="Asynchronous Server Gateway Interface">[ASGI](https://asgi.readthedocs.io/)</abbr> specification, you can use any ASGI middleware.
A middleware doesn't have to be made for FastAPI or Starlette to work, as long as it follows the ASGI spec.