Import ErrorAll platformsPython 3.8 · 3.9 · 3.10 · 3.11

ImportError: cannot import name 'apimodel' from 'fastapi_utils.api_model'

pip install fastapi-utils
>>> from fastapi_utils.api_model import apimodel
ImportError: cannot import name 'apimodel' from 'fastapi_utils.api_model'
(/usr/local/lib/python3.11/site-packages/fastapi_utils/api_model.py)

Python imports are case-sensitive. The class is APIModel (all-caps API prefix, then Model). apimodel in lowercase does not exist in fastapi_utils.api_model.

Linux · Python 3.11
lowercase · failsAPIModel · ok
macOS · Python 3.11
lowercase · failsAPIModel · ok
Windows · Python 3.11
lowercase · failsAPIModel · ok

1Use the correct class name APIModelEasiest

The class follows Python convention for acronyms: API is uppercased in full, giving APIModel. Import it with the exact casing.

from fastapi_utils.api_model import APIModel

class MyRequest(APIModel):
    name: str
    count: int

fastapi-utils · Compatibility Matrix
See install results across all Python versions and operating systems
→
Observed in 86 searches · Last verified Aug 2026
ImportError: cannot import name 'apimodel' from 'fastapi_utils.api_model' — fastapi-utils