This repository provides a FastAPI-based API that automatically generates professional LinkedIn-style posts using OpenAI-compatible models.
The API supports two key domains:
- 🩺 AI in Healthcare
- 🧑💻 Remote Work Productivity
Each endpoint produces a 2–4 paragraph LinkedIn post written in a professional, engaging tone, complete with hashtags and emojis, in any specified language.
git clone https://github.com/yourusername/LinkedIn-Post-Generator.git
cd LinkedIn-Post-Generatorpython -m venv venv
source venv/bin/activate # On macOS/Linux
venv\Scripts\activate # On Windows
pip install -r requirements.txt
requirements.txt
fastapi==0.115.6
uvicorn==0.32.1
openai==1.66.3
python-dotenv==1.0.1
pydantic==2.10.6BASE_URL="https://models.github.ai/inference"
API_KEY="your_api_key_here"
MODEL_NAME="openai/gpt-4.1-nano"uvicorn main:app --reloadThen open your browser and go to:
http://127.0.0.1:8000/docs
You’ll see the Swagger UI, where you can interact with the API endpoints directly.
- Loads environment variables from
.env. - Initializes the OpenAI client using the provided base URL and API key.
- Builds a prompt dynamically based on the request topic and language.
- Returns a professional LinkedIn-style post as a JSON response.
- Never expose your
.envor API key in public repositories. - Use environment variables in deployment environments.
- Consider adding authentication if deploying publicly.
Md. Zobayer Ibna Kabir
- 📧 Email: ibnakabir081@gmail.com
- 💻 GitHub: ZobayerAkib
- 💼 LinkedIn: Md. Zobayer Ibna Kabir
✨ Let's collaborate, share knowledge, and create amazing projects together!