Skip to content

Glossary: Building APIs with FastAPI

Response model

Also written: response_model

The model, usually written as the return type hint, that controls what an endpoint sends back. FastAPI checks the result against it and sends only its fields, so hidden ones such as `stock` can't leak.

Where the book teaches it

Related terms

PydanticHTTPException