Start here. This is the direct spoken answer to practice first.
Overview
Returning a direct response is an escape hatch that trades managed guarantees for precise HTTP control.
I normally return data and let FastAPI apply the declared response model, serialization, status, and media type. I return a Response subclass directly when I need exact control, such as a redirect, file, stream, non-JSON body, or specially constructed headers. FastAPI passes a direct response through without Pydantic conversion or response-model validation. That means the code creating it owns the body, headers, status, media type, and consistency with the documented contract.