# BaseModel

*noun*

say it: **“BAYS MOD-ul”** **/beɪs ˈmɑdəl/**

The Pydantic class your data models inherit from; each field is written as a class attribute with a type hint.

## What is **BaseModel**?

`BaseModel` is the Pydantic class your data models inherit from. Each field is a class attribute with a type hint.

```python
from pydantic import BaseModel

class RecipeIn(BaseModel):
    title: str
    minutes: int
    vegetarian: bool = False
```

## In a sentence

- “class Application(**BaseModel**) gave the API its checked request model.”
- “Every request and response model in the course inherits from **BaseModel**.”

Level: Apprentice · [More FastAPI terms at this level](https://www.ask-codey.com/glossary?category=fastapi&level=2)

Updated: November 19, 2026

Source: https://www.ask-codey.com/glossary/basemodel
