Introduction to LenAPI
A lightweight ASGI framework that helps developers spin up APIs quickly in a few steps.
Start with the shape of your idea.
Follow a guide, copy a working example, and build up one part of your backend at a time.
Explore routingfrom lenapi import LENAPI
app = LENAPI()
@app.get("/hello")
def hello():
return {"message": "Hello, world!"}Understand what LenAPI includes, then follow the quickstart and focused guides to build your application step by step.
What is LenAPI?
LenAPI is a lightweight Python ASGI framework shaped by real-world backend development. It helps developers spin up APIs quickly in a few steps, with routing, validation, data access, and interactive documentation in one toolkit.
What can you build with it?
Key features include:
- Typed routes, Pydantic validation, and interactive Swagger/OpenAPI docs
- ORM models, migrations, and sync or async database access
- Authentication options including JWT, API keys, sessions, OIDC, and social sign-in
- WebSockets for chat, video signaling, JSON, text, and binary messages
- Built-in webhook handling for flexible JSON payloads and verified senders
- Caching, background tasks, file uploads, middleware, and request throttling
- Optional OpenAI, Ollama, and Faker integrations
How this documentation is organized
Start with the quickstart to install LenAPI and create your first app. Then follow the guides for routing, validation, data access, security, realtime features, testing, and deployment. Each guide includes practical code you can adapt.
from lenapi import LENAPI
app = LENAPI()
@app.get("/health")
def health():
return {"status": "ok"}The generated development server defaults to http://127.0.0.1:8009, and Swagger UI is available at /docs/.