Response Model and Status Codes
Use response_model to filter and document API responses, set appropriate HTTP status codes, and use response_model_include/exclude for field control.
Custom Responses
Return JSONResponse, HTMLResponse, StreamingResponse, FileResponse, and RedirectResponse from FastAPI — with custom headers and media types.
Error Handling and HTTP Exceptions
Raise HTTPException with detail payloads, create custom exception handlers, and return consistent error responses across your FastAPI application.