Learn how to create a modern API service using FastAPI’s powerful features. This guide shows you how to deploy a Python-based API with automatic scaling.

What you’ll learn

FastAPI

Build modern Python APIs

Autoscaling

Deploy with automatic scaling

Performance

Create high-performance endpoints

Documentation

Auto-generate API docs

Create your API

1

Fork the template

Sign in to Replit and fork the FastAPI template. Select + Use Template and follow the prompts to create your Replit App.

FastAPI automatically generates interactive API documentation at /docs.

2

Configure deployment

  1. Select Deploy in the workspace header
  2. Choose Autoscale deployment
  3. Configure your deployment:
    • Machine: 1vCPU, 2 GiB RAM (default)
    • Max machines: 3 (default)
    • Run command: uvicorn main:app --host 0.0.0.0

Autoscale deployments automatically adjust resources based on API traffic.

3

Launch

Select Deploy to start the deployment process. Your API will be live in a few minutes!

Customization options

Endpoints

  • Add new routes
  • Implement validation
  • Handle authentication

Documentation

  • Customize API docs
  • Add examples
  • Define schemas

Next steps

Want to learn more about API development? Check out our deployment documentation.