The response model, declared with response_model, defines the shape of what the API returns. FastAPI filters and validates the output according to this model, which avoids exposing sensitive fields such as a password, and documents the response.
Example
@app.get('/users/{id}', response_model=UserPublic)
def lire(id: int): ...