Hey folks!

If you’re like me, you probably keep hearing about how AI is changing everything and how there are all these ways to make some money on the side using it. But most articles are either too high-level or super vague. So I thought I’d share a real, working example you can try out right now, with code you can copy, tweak, and make your own.

Let’s build a small tool that uses AI to help people write blog posts faster. You can use it for yourself, or offer it as a service to others (think freelance gigs, or even a small SaaS).


What We’ll Build

A command-line Python app that:

  • Takes a blog topic from the user
  • Uses OpenAI to generate an outline and a draft
  • Saves the draft to a file

You can run this on your laptop, or turn it into a web app later. The main thing is: it works, and it’s a great starting point for side projects.


Step 1: Set Up Your Project

First, make a new folder and set up a virtual environment:

mkdir ai-blog-helper
cd ai-blog-helper
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

Now install the OpenAI library:

pip install openai

Step 2: Get Your OpenAI API Key

You’ll need an OpenAI API key.

Sign up at platform.openai.com, grab your key, and save it somewhere safe.


Step 3: The Code

Create a file called blog_helper.py and paste this in:

import os
import openai

# Load your API key from an environment variable
openai.api_key = os.getenv("OPENAI_API_KEY")

def get_outline(topic):
    prompt = f"Write a simple outline for a blog post about '{topic}'."
    response = openai.ChatCompletion.create(
        model="gpt-3.5-turbo",
        messages=[{"role": "user", "content": prompt}],
        max_tokens=250,
    )
    return response.choices[0].message['content'].strip()

def get_draft(topic, outline):
    prompt = (
        f"Write a blog post about '{topic}' using this outline:\n{outline}\n"
        "Make it clear, friendly, and helpful."
    )
    response = openai.ChatCompletion.create(
        model="gpt-3.5-turbo",
        messages=[{"role": "user", "content": prompt}],
        max_tokens=800,
    )
    return response.choices[0].message['content'].strip()

def main():
    topic = input("What’s your blog post topic? ")
    print("\nGenerating outline...")
    outline = get_outline(topic)
    print("\nOutline:\n", outline)

    go_ahead = input("\nGenerate full draft? (y/n): ")
    if go_ahead.lower() != 'y':
        return

    print("\nGenerating draft...")
    draft = get_draft(topic, outline)
    print("\nDraft:\n", draft)

    filename = topic.replace(" ", "_") + ".txt"
    with open(filename, "w", encoding="utf-8") as f:
        f.write(draft)
    print(f"\nSaved to {filename}")

if __name__ == "__main__":
    main()

Don’t forget to set your API key in your terminal before running:

export OPENAI_API_KEY=your-api-key-here

Step 4: Run It

Just do:

python blog_helper.py

Type your topic, and you’ll get an outline and a draft. The draft will be saved as a text file.


How Can You Make Money With This?

Here are a few ideas:

  • Freelance writing: Offer to write blog posts for small businesses using your tool to speed things up.
  • Create a simple website: Let people enter a topic and get a draft (charge per use or with a subscription).
  • Niche content sites: Use your tool to fill up a blog with posts, then monetize with ads or affiliate links.

What’s Next?

  • Add more options (like tone, length, or target audience)
  • Turn it into a web app with Flask or Next.js
  • Connect to Google Docs or Notion for easy publishing

Final Thoughts

You don’t need to build something huge to start making a bit of extra money with AI. Start small, keep it simple, and see where it takes you. If you try this out, let me know how it goes or if you have questions!

Happy coding! 🚀


PS: If you want a complete article about this just check my previous one