AutoKaam Playbook
FastAPI, the Empire's Default Python Serving Layer
Async by default, OpenAPI for free, and the framework I reach for first when I need an HTTP endpoint.
Last reviewed:
The operator take
I have written FastAPI more in 2025-26 than any other framework, by a wide margin. Empire APIs (PramaanAI data endpoints, taxwallaai RZP webhooks, recon pipeline endpoints, kaam-tracker invoice service) all run on FastAPI behind Coolify on Oracle ARM. There is no second-place candidate.
Why I keep coming back: async-by-default actually matters when half your endpoints are calling out to Claude or scraping AmbitionBox. The OpenAPI generation gives me a free Swagger UI for every API I ship, which has saved me from "what was the request shape again" half a dozen times. Pydantic validation catches malformed inputs before they reach my logic. Dependency injection keeps auth and rate-limit clean.
The thing I screwed up early: running FastAPI behind Gunicorn-with-sync-workers because "everyone runs Django that way". That fights the whole point of the framework. I moved to Uvicorn workers, then to Granian (the Rust-based ASGI server) for the higher-throughput empire endpoints. Granian buys me roughly 2x raw RPS over Uvicorn at the same memory footprint. The Indian-operator angle is that on a Rs 1,200 a month Oracle ARM box, that 2x means I can run two empire APIs on one box instead of two.
The 2026 thing to watch is FastAPI's first-class support for streaming responses. Most LLM endpoints stream. The pattern is StreamingResponse plus an async generator yielding tokens, and FastAPI now handles that without the contortions I had to write in 2024. PramaanAI's Claude-streaming endpoint is 30 lines.
FastAPI's only real failure mode is when you try to do too much in the framework. Authentication via FastAPI dependencies works for simple cases; for anything past basic JWT, lift it out into a middleware or a separate auth service. The recon pipeline learned this the hard way when I had three layers of dependency-overrides hiding what was actually happening. The fix: one auth middleware, dependencies for tenancy only.
If you are building empire-scale Python APIs in 2026 and reach for Flask, you are paying a 5-year-old tax. Go FastAPI. The starting point: pip install fastapi, write five endpoints, deploy to Coolify, sleep well.
The one alternative worth considering is Litestar, which has a cleaner DI story, but the ecosystem is half the size. I keep watching it.
Why it matters in 2026
Most LLM-shaped Python work needs async (you are calling external APIs constantly). Most APIs need typed requests and responses (Pydantic). Most consumers want OpenAPI clients. FastAPI delivers all three in one package and remains the dominant choice for new Python APIs in 2026.
Cost in INR
Free open source; running cost depends on host (Rs 1,200/mo Oracle ARM via Coolify is empire baseline)
Use when
- +Any new Python HTTP API you are starting in 2026
- +Endpoints that call LLMs or external APIs (async wins matter)
- +When you want a free Swagger UI for the team
- +Microservices and webhook handlers
Skip when
- xHeavy admin-panel + ORM workflows (Django wins on batteries)
- xStateful WebSocket apps with persistent connections (consider Channels)
- xWhen the team has zero async Python experience and tight deadline
Alternatives I would consider
Read next
Adjacent in the playbook
Free open source; running cost depends on host (Rs 1,200/mo Oracle ARM via Coolify supports 5+ empire apps)
PocketBase, the Empire Backend I Run Across Every Project
Free open source; Oracle ARM free tier covers 4-core 24GB; Rs 1,200/mo for paid scale-out instances
Coolify on Oracle ARM, the Empire Hosting Stack
Free at entry; Pro from Rs 2,000/mo (only needed for advanced WAF / analytics)
Cloudflare Pages, the Empire Static Hosting I Have Never Regretted
Free at 100K daily requests; Paid from Rs 500/mo for higher volume + larger CPU budgets