This Tiny Python Script Turned My AI Idea into a Working SaaS
TL;DR: A 100-line Python script, some FastAPI magic, and OpenAI’s API were all I needed to launch my AI-powered micro-SaaS in a weekend.
Like many devs, I’ve had countless AI app ideas. Most never left the notes app.
But this one did — and the secret? I didn’t overbuild. I wrote a simple Python script that turned into a functioning SaaS app with real users and revenue.
Here’s exactly how I did it — no VC, no frameworks, no fluff.
💡 The Idea I noticed content creators waste time rewriting articles for different tones — professional, casual, persuasive, etc. So I built a “Tone Transformer”: paste your text, choose a tone, get a rewritten version instantly.
No login. No dashboard. Just input > AI > output.
🧪 The Stack
- 🐍 Python for the core logic
- ⚡ FastAPI for the API layer
- 🤖 OpenAI API for text generation
- 🌐 Vercel (frontend) + Render (backend) for deployment
- 💳 Stripe Checkout for monetization
Yes, all of this fit in a single Python file (under 100 lines to start).
🔧 The Core Python Script Here’s the heart of the app:
python
from fastapi import FastAPI, Request
import openai
import os
openai.api_key = os.getenv("OPENAI_API_KEY")
app = FastAPI()
@app.post("/transform")
async def transform(request: Request):
data = await request.json()
text = data["text"]
tone = data["tone"]
prompt = f"Rewrite the following text in a {tone} tone:\n\n{text}"
response = openai.ChatCompletion.create(
model="gpt-4",
messages=[{"role": "user", "content": prompt}]
)
return {"result": response['choices'][0]['message']['content'].strip()}
🧠 Why it worked:
- One endpoint
- Minimal dependencies
- Easy to test and deploy
⚙️ How I Turned It Into a SaaS ✅ Step 1: Wrap the API with a no-code frontend (Typedream) I used a simple form:
- Text input
- Dropdown for tone
- Call /transform endpoint
- Display the result
✅ Step 2: Add Stripe Checkout No subscriptions. Just $5 for unlimited transformations. Stripe + one webhook + one API key check was enough. ✅ Step 3: Deploy in 20 minutes
- Render: Hosted FastAPI backend (free tier)
- Typedream: Frontend (no code)
- Cloudflare: Free custom domain + SSL
📊 Usage Stats After 2 Weeks
- 2,100+ tone transformations
- 300+ unique users
- $90 revenue from Stripe (✅ validated!)
- $0 infra cost (thanks to free tiers)
⚡ Why This Worked
- FastAPI + OpenAI API = lightning fast idea-to-product loop
- No database, no user accounts, no complexity
- I focused on one job: rewrite text in a specific tone
- Made it dead simple for the user
🚀 Lessons for Indie Hackers & Devs
- Don’t build a product. Build a working script first.
- If it solves your problem, it might solve others’ too
- FastAPI is perfect for AI microservices
- OpenAI + Python can turn any idea into a SaaS in hours
- Skip fancy tools unless you need them — validate first!
🔚 Final Thoughts That tiny Python file was all I needed to go from idea → usable product → Stripe payment. If you’re sitting on an AI idea, don’t wait for the “perfect” stack. Start with one file, one endpoint, one user. Because that’s all it takes to ship.
Read the full article here: https://medium.com/@hadiyolworld007/this-tiny-python-script-turned-my-ai-idea-into-a-working-saas-d5630f135f46