Skip to main content
Version/Environment (if relevant): Domino Version 6.1 and Above

What:

Domino’s Simple FastAPI example is a great way to get started with FastAPI in Domino, but what if you’re ready to go a step further and set up a FastAPI app to take multiple GET and POST requests? This guide assumes you’ve already installed FastAPI in your environment or set it up to install via requirements.txt.

How:

app.sh

Like many of our other App examples, this simply calls the Python script:

Python script

First, we need to import our packages and collect some environment variables:
Domino utilizes a reverse proxy, and App URLs have path prefixes that need to be included (e.g. /username/app-name/app). Therefore, we need to set a root_path for our FastAPI app (see https://fastapi.tiangolo.com/advanced/behind-a-proxy/#setting-the-root_path-in-the-fastapi-app). With that example in mind, I was able to get to the swagger UI by modifying our code example as follows:
We can then add routes as desired for our API:
Lastly, run the app:
Putting it all together, the complete app.py looks like:
Similar to our Simple FastAPI example, hitting “View App” will bring up your FastAPI app with our “Hello World” message. While our root page is accessible via the “official” app URL, you aren’t able to append paths to this. For this, you need to use the session URL: http://<your-domino-url>/<user>/<project>/r/notebookSession/<session_id> (see App URLS and URL parameters). To find this easily, you might add a print statement to your app.py, such as:
…which would print in your User Output when you start your App. With that URL, you can utilize your other endpoints. For example: http://<your-domino-url>/<userID>/<projectID>/r/notebookSession/<runID>/item/foo You can also view the Swagger UI for your FastAPI app at: http://<your-domino-url>/<userID>/<projectID>/r/notebookSession/<runID>/docs You’re all set.

Notes/Information:

https://support.domino.ai/support/s/global-search/fastAPI

References/Internal Records:

Last modified on October 12, 2026