📦 Install and run
Install FastAPI with its standard extras (this includes the fastapi command and the Uvicorn server), then save the code below as main.py.
Open http://127.0.0.1:8000 to see the JSON, /docs for the interactive Swagger UI, and /redoc for the alternative documentation. Both are generated from your code and the OpenAPI schema at /openapi.json.