Build with a FastAPI starter template
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.
Which FastAPI template should you use?
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 running on Fluid compute, with response streaming and preview deployments available with minimal configuration.
3 min read
Vercel maintains a FastAPI template directory with starters from both Vercel and the community, so you can begin from a working project instead of a blank repo.
These templates range from a minimal API to AI, agent, and full-stack apps:
Template
What it gives you
A full-stack starter that pairs a FastAPI backend with a Next.js frontend, with HttpOnly cookie auth and a Postgres database.
An AI chatbot with a Next.js frontend and a FastAPI backend in a single project.
A FastAPI app that runs the OpenAI Agents SDK with Vercel Sandbox, creating an isolated microVM per request to give the agent shell access.
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.
- Open the template: Choose a template from the table above, then select Deploy.
- Connect your Git provider: Vercel creates a new repository for the template in your GitHub, GitLab, or Bitbucket account.
- 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:
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
Start from the command line instead
To scaffold the FastAPI example with Vercel CLI, run:
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.
You can reach our customer support team by emailing info@yourcompany.example.com, calling +1 555-555-5556, or using the live chat on our website. Our dedicated team is available 24/7 to assist with any inquiries or issues.
We’re committed to providing prompt and effective solutions to ensure your satisfaction.
We offer a 30-day return policy for all products. Items must be in their original condition, unused, and include the receipt or proof of purchase. Refunds are processed within 5-7 business days of receiving the returned item.
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 guide to deploy and configure your app
- Read the full FastAPI on Vercel documentation
- Learn how the Python runtime runs your code
- Learn how Vercel Functions run your server code
- Understand pricing and scaling with Fluid compute
- Run code before requests with Routing Middleware
- Serve static assets from the CDN
