---
title: Deploy FastAPI with AI on Blossom
url: "/deploy/python-fastapi/"
canonical_url: https://blossom88.com/deploy/python-fastapi/
markdown_url: https://blossom88.com/deploy/python-fastapi.md
summary: Deploy the FastAPI starter, call its greeting endpoint, and ship a change
  to the API.
categories:
- quickstarts
- frameworks
- python
- api
- deployment
stack:
- Python
- FastAPI
- Uvicorn
---

# Deploy FastAPI with AI on Blossom

[FastAPI](https://fastapi.tiangolo.com/) is a Python framework for building
HTTP APIs. This [starter project](https://github.com/blossom-examples/python-fastapi)
gives you a live endpoint you can call, change, and redeploy.

![The FastAPI demo page returning its original greeting for Ada.](/deploy/assets/images/python-fastapi/first-request.webp)

![FastAPI's interactive API docs returning the updated greeting for Ada.](/deploy/assets/images/python-fastapi/updated-greeting.webp)

## Ask Your Agent

> **Ask your AI agent:** Deploy the FastAPI starter on Blossom and help me make my first API request.
>
> Follow this guide: https://blossom88.com/deploy/python-fastapi/

[Install the Blossom CLI and skill](https://docs.blossom88.com/learn/getting-started/install/) on your agent's machine and [choose a Location in your cloud account](https://docs.blossom88.com/learn/getting-started/choose-your-cloud/#connect-your-provider).

## Have Ready

Nothing is required beyond your Blossom account.

- **A repository you can edit** (Later): Fork or copy the starter when you want to change its code.

## How It Runs

| Part | Role | Where |
|---|---|---|
| FastAPI and Uvicorn | Serve the demo page, API documentation, and JSON responses | One web Service on App Capacity |
| Buildpack | Install Python dependencies from requirements.txt and build the App | Blossom Builder |

## Deploy FastAPI

Choose **Deploy FastAPI starter** to open New App with the repository and web
Service filled in, or copy the prompt into your agent. Review the location
and App name before deploying.

<details class="optional-reading" markdown="1">
<summary>Commands your agent runs</summary>

    blossom app_plan:create --data '{"app_plan":{"quickstart":"python-fastapi"}}'
    blossom app_plan:deploy --id app_plan-100 --follow

</details>

## Make an API Request

Open the App's HTTPS address and try **Get Greeting** with a name.
Open `/docs` to make the same request through FastAPI's interactive docs.

> **Ask your AI agent:** Call the deployed greeting endpoint with the name Ada and show me the response.

> Follow this guide: https://blossom88.com/deploy/python-fastapi/



<details class="optional-reading" markdown="1">
<summary>Commands your agent runs</summary>

    curl --fail "https://your-app.example.com/api/hello?name=Ada"

</details>

## Change the Greeting

In a copy of the starter you can edit, change the greeting in `main.py`.
Push the change and point the Environment at your repository and branch.
Deploy again and call the same endpoint to see the new response.

> **Ask your AI agent:** Change the starter's greeting to say Welcome, Ada, redeploy it, and check the same endpoint again.

> Follow this guide: https://blossom88.com/deploy/python-fastapi/



<details class="optional-reading" markdown="1">
<summary>Commands your agent runs</summary>

git-repo.yml:

```yaml
git_repo:
  clone_url: https://github.com/your-account/python-fastapi
  branch: main
```

    blossom git_repo:update --id git_repo-100 --data git-repo.yml
    blossom environment:deploy --id environment-100 --follow
    curl --fail "https://your-app.example.com/api/hello?name=Ada"

</details>

## Keep It Running

Use the release history to see which Git revision is serving requests.
Check the endpoint after each change before sharing it.

> **Ask your AI agent:** Show me which release is live and confirm it serves the updated greeting.

> Follow this guide: https://blossom88.com/deploy/python-fastapi/



<details class="optional-reading" markdown="1">
<summary>Commands your agent runs</summary>

    blossom release:list --environment environment-100
    blossom container:list --service service-100

</details>

## What You Get

- A Python API with its own HTTPS address
- A browser demo and interactive API docs
- A greeting endpoint you can change and redeploy

Tested on Blossom: The greeting changed on the same HTTPS address after a Git update replaced the web Container.
