Jump to content

The AI Prompt That Accidentally Built Me a Full Business

From JOHNWICK

Photo by Aidin Geranrekab on Unsplash

1. How It All Began (With a Simple Curiosity)

I didn’t set out to build a business. I was just playing around with the OpenAI API one night, trying to automate some writing tasks. I had a simple idea:

“What if I could feed AI a few bullet points and get a polished article out of it?” It sounded fun — maybe even useful. So I wrote a few lines of Python to test it. But what I didn’t expect was that this small experiment would become a full-blown AI-powered content system… and start generating income.

2. The First Working Prototype

I started with the OpenAI Python SDK — nothing fancy, just a proof of concept:

from openai import OpenAI

client = OpenAI(api_key="your_api_key")

def generate_blog(title, bullet_points):
    prompt = f"Write a detailed blog titled '{title}' based on these points:\n{bullet_points}"
    response = client.chat.completions.create(
        model="gpt-4o-mini",
        messages=[{"role": "user", "content": prompt}]
    )
    return response.choices[0].message.content

blog = generate_blog("How AI Is Changing Productivity", "- automation\n- focus tools\n- workflows")
print(blog)

It worked better than expected. The AI produced human-like writing, clean formatting, and even a natural tone.

That was the moment I realized: this could be more than a toy. 3. Adding Structure — Templates That Sell Soon, I noticed something interesting: when I shared AI-generated articles online, people asked “What tool are you using?”

So I built templates for:

  • Blog generation
  • Product descriptions
  • LinkedIn posts
  • YouTube scripts

Each template had its own optimized prompt.

templates = {
    "blog": "Write an engaging blog post titled '{title}' in a friendly, expert tone. Cover these key ideas:\n{points}",
    "product": "Create a product description for {product_name} highlighting {features}.",
    "youtube": "Write a YouTube video script about {topic} that keeps viewers hooked."
}

Then I created a web interface for it.

4. Turning the Script Into a Web App

I used Flask to turn the backend into a simple web application:

from flask import Flask, render_template, request
app = Flask(__name__)

@app.route("/", methods=["GET", "POST"])
def index():
    if request.method == "POST":
        title = request.form["title"]
        content = generate_blog(title, request.form["points"])
        return render_template("index.html", blog=content)
    return render_template("index.html")

With some HTML and Bootstrap styling, I had a clean interface that looked surprisingly professional.

5. The Big Shift — Letting Users Pay for It

People loved the results, but then the question came: “Can you make it so I can use this too?”

That’s when I decided to add Stripe payments and offer it as a simple AI writing service.

import stripe
stripe.api_key = "your_secret_key"

@app.route("/create-checkout-session", methods=["POST"])
def checkout():
    session = stripe.checkout.Session.create(
        payment_method_types=['card'],
        line_items=[{
            'price_data': {
                'currency': 'usd',
                'product_data': {'name': 'AI Writing Credits'},
                'unit_amount': 500,
            },
            'quantity': 1,
        }],
        mode='payment',
        success_url="https://myaiwriter.com/success",
        cancel_url="https://myaiwriter.com/cancel"
    )
    return redirect(session.url, code=303)

I didn’t expect much. But in the first week, I had 12 paying users — all from Reddit and Twitter.

6. Scaling with Automation

To make it scalable, I added background automation:

  • Auto-save generated content to Google Drive
  • Auto-email results to users
  • Auto-generate summaries for SEO

Here’s a snippet of the Google Drive automation:

from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive

gauth = GoogleAuth()
gauth.LocalWebserverAuth()
drive = GoogleDrive(gauth)

def save_to_drive(filename, content):
    file = drive.CreateFile({'title': filename})
    file.SetContentString(content)
    file.Upload()

Now, every generated article got stored in the user’s Drive — a perfect hands-free experience.

7. The “Aha” Moment: Passive Income from AI

By automating everything — writing, delivery, and payments — I had built something that ran itself.
No customer service. 
No manual content creation.
Just a small Python app quietly generating income while I focused on new projects. That’s when I realized the core lesson of AI monetization: You don’t have to build the next ChatGPT. You just have to automate a real problem people already have.

8. Expanding to More AI APIs

I integrated Claude, Gemini, and Perplexity for comparison and flexibility.

def choose_model(provider, prompt):
    if provider == "openai":
        return client.chat.completions.create(model="gpt-4o", messages=[{"role": "user", "content": prompt}])
    elif provider == "claude":
        # pseudo code for Anthropic API
        pass
    elif provider == "gemini":
        # pseudo code for Google Gemini
        pass

Users could now select which AI they wanted to use — and pay different rates for each. That one feature doubled conversion rates overnight.

9. Analytics, Logs, and User Tracking

I wanted insights into how users interacted with the tool — so I built a simple analytics system using SQLite.

import sqlite3

conn = sqlite3.connect("usage.db")
conn.execute("CREATE TABLE IF NOT EXISTS logs (id INTEGER PRIMARY KEY, user TEXT, model TEXT, date TIMESTAMP DEFAULT CURRENT_TIMESTAMP)")
conn.commit()

def log_usage(user, model):
    conn.execute("INSERT INTO logs (user, model) VALUES (?, ?)", (user, model))
    conn.commit()

This helped me understand user behavior, optimize prompts, and refine pricing. 10. Turning It Into a SaaS

Eventually, I packaged everything into a proper SaaS called PromptFlow — built with Flask + Tailwind + SQLite. It lets users:

  • Generate content from structured prompts
  • View past generations
  • Manage credits
  • Pay securely

All hosted on Render with cron jobs for automation. Here’s what a typical cron job looked like for email summaries:

0 0 * * * python email_reports.py

Every night, the system emails users a summary of their AI activity — automatically. 11. The Moment I Realized It Was Real

When I woke up one morning and saw an email that said “You’ve received $49.00 from Stripe”, I just stared at the screen for a moment.
That was the first time I made money while sleeping — from something I built with AI.

And that’s when I understood the new reality: In the AI era, the real winners aren’t the biggest models. They’re the people who know how to use them smartly.

Read the full article here: https://medium.com/@SulemanSafdar/the-ai-prompt-that-accidentally-built-me-a-full-business-3a09c80e36cf