---
title: Build with a FastAPI starter template
description: Browse FastAPI starter templates for Vercel and deploy one in a few steps. Compare minimal, AI, agent, and full-stack FastAPI templates on the Python runtime.
url: "https://vercel.com/kb/guide/build-with-a-fastapi-starter-template"
published: 2026-06-15
last_updated: 2026-10-15
authors: Ben Sabic
install_vercel_plugin: npx plugins add vercel/vercel-plugin
search_with_vercel_cli: npx vercel@latest kb search "<query>"
read_with_vercel_cli: "npx vercel@latest kb inspect build-with-a-fastapi-starter-template"
---

FastAPI is a high-performance Python web framework for building APIs, and it deploys to Vercel with zero configuration. On Vercel, your FastAPI app becomes a [Vercel Function](https://vercel.com/docs/functions) running on [Fluid compute](https://vercel.com/fluid), with response streaming and preview deployments available with minimal configuration.

Vercel maintains a [FastAPI template directory](https://vercel.com/templates?search=fastapi) with starters from both Vercel and the community, so you can begin from a working project instead of a blank repo.

## Which FastAPI template should you use?

These templates range from a minimal API to AI, agent, and full-stack apps:

| Template                                                                                                           | What it gives you                                                                                                                                                         |
| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [FastAPI Boilerplate](https://vercel.com/templates/python/fastapi-python-boilerplate)                              | A minimal FastAPI app that runs on Vercel's Python runtime and deploys with zero configuration. Start here if you're new to FastAPI on Vercel.                            |
| [Next.js FastAPI Starter](https://vercel.com/templates/next.js/nextjs-fastapi-starter)                             | An AI chatbot with a [Next.js](https://nextjs.org/) frontend and a FastAPI backend in a single project.                                                                   |
| [OpenAI Agents SDK with FastAPI](https://vercel.com/templates/other/openai-agents-sdk-with-vercel-sandbox-fastapi) | A FastAPI app that runs the OpenAI Agents SDK with [Vercel Sandbox](https://vercel.com/sandbox), creating an isolated microVM per request to give the agent shell access. |
| [Full-stack FastAPI with Next.js](https://vercel.com/templates/other/full-stack-fastapi-template-with-next-js)     | A full-stack starter that pairs a FastAPI backend with a Next.js frontend, with `HttpOnly` cookie auth and a Postgres database.                                           |

If you're not sure where to begin, deploy the FastAPI Boilerplate and add routes, middleware, or a frontend as your project grows.

## Deploy a FastAPI template

Most FastAPI templates deploy to Vercel the same way. Open the template you want, select Deploy, and Vercel clones the repository into your Git provider, creates a project, and ships it to a live URL.

1. **Open the template**: Choose a template from the table above, then select Deploy.
   
2. **Connect your Git provider**: Vercel creates a new repository for the template in your GitHub, GitLab, or Bitbucket account.
   
3. **Deploy the project**: Vercel builds and deploys the template, then returns a production URL. Each later push to the repository triggers a new deployment.
   

The full-stack FastAPI with Next.js template is the exception. It provisions two projects, one for the frontend and one for the backend, along with a Postgres database, so you'll set a few environment variables during setup. Follow its template page for the exact steps.

### Run the template locally

After deploying, clone your new repository, set up a virtual environment, install dependencies, and start the development server with [Vercel CLI](https://vercel.com/docs/cli):

```bash
git clone your_repository_url_here
cd your_project_name_here
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
vercel dev
```

Vercel CLI serves your app at `http://localhost:3000` and runs it the same way it does in production. Edit your route handlers to make it your own.

Templates that include a Next.js frontend, such as Next.js FastAPI Starter or the full-stack template, also require their Node dependencies to be installed. Run `npm install` (or the package manager the template uses) before `vercel dev`.

### Start from the command line instead

To scaffold the FastAPI example with Vercel CLI, run:

```bash
vercel init fastapi
```

This clones the FastAPI boilerplate into a `fastapi` directory, so you can develop locally first and deploy with `vercel` when you're ready.

## Resources and next steps

- Follow the end-to-end [How to ship a FastAPI app on Vercel](https://vercel.com/kb/guide/ship-a-fastapi-app-on-vercel) guide to deploy and configure your app
  
- Read the full [FastAPI on Vercel documentation](https://vercel.com/docs/frameworks/backend/fastapi)
  
- Learn how the [Python runtime](https://vercel.com/docs/functions/runtimes/python) runs your code
  
- Learn how [Vercel Functions](https://vercel.com/docs/functions) run your server code
  
- Understand pricing and scaling with [Fluid compute](https://vercel.com/docs/fluid-compute)
  
- Run code before requests with [Routing Middleware](https://vercel.com/docs/routing-middleware)
  
- Serve static assets from the [CDN](https://vercel.com/docs/cdn)

## Related Documentation

- [Fluid compute](/docs/fluid-compute)
- [Vercel Functions](/docs/functions)

## More Fluid compute guides

- [Vercel vs Webflow Cloud](/kb/guide/vercel-vs-webflow-cloud): Compare Vercel and Webflow Cloud for deploying Next.js and Astro apps, including runtime, framework support, storage, pricing, and where your code runs.
- [Next.js on Vercel vs Webflow Cloud](/kb/guide/next-js-on-vercel-vs-webflow-cloud): Compare running Next.js on Vercel Functions with Fluid compute against Webflow Cloud on Cloudflare Workers. Learn how Next.js feature support, runtimes, storage, pricing, and developer experience differ so you can choose the right platform.
- [Astro on Vercel vs Webflow Cloud](/kb/guide/astro-on-vercel-vs-webflow-cloud): Compare running Astro on Vercel Functions with Fluid compute against Webflow Cloud on Cloudflare Workers. Learn how Astro feature support, runtimes, storage, pricing, and developer experience differ so you can choose the right platform.

## Reference Architecture

Choose a stack and work through the decisions behind it, with curated documentation, guides, templates, and courses to help you build.

- [Agent stack](/kb/architecture/agents): Build and operate agents with models, tools, and durable workflows.
- [Web applications](/kb/architecture/web): Choose rendering, data, authentication, and caching approaches.
- [Backends](/kb/architecture/backends): Choose a runtime, connect services, and run background work.

[Browse all stacks](/kb/architecture)

## Build with prompts

Build an app, extend an agent, or improve your project with ready-to-use prompts for your coding agent.

[Browse the prompt library](/kb/prompts) · [Read the Markdown index](/kb/prompts.md)

## Search guides from your terminal

Search the Knowledge Base and read guides as Markdown with the Vercel CLI. No login required.

```bash
# Find guides by keyword
npx vercel@latest kb search "rewrites and redirects"
npx vercel@latest kb search "AI SDK streaming"

# Show the latest guides
npx vercel@latest kb

# Print a guide as Markdown, by slug or URL
npx vercel@latest kb inspect <guide>
```
