The easiest way to resolve this is to add a root_path argument to your FastAPI instance:
app = FastAPI( root_path="/api", docs_url="/" )