Python Flask API using OpenAI’s GPT model to generate smart summaries.
- AI-generated summaries using GPT-3.5
- Adjustable summary length:
short,medium, orlong - Optional style tone:
formalorcasual - JSON-based POST endpoint for easy integration
curl -X POST http://127.0.0.1:5000/api/summarize \
-H "Content-Type: application/json" \
-d '{
"text": "Your long input text here...",
"length": "short",
"style": "casual"
}'- Clone this repo:
git clone https://github.com/jonathanpereda/smart-summarizer-api.git
cd smart-summarizer-api- Create a virtual environment and activate it:
python3 -m venv venv
source venv/bin/activate- Install dependencies:
pip install -r requirements.txt- Add your OpenAI API key to a
.envfile:
OPEN_API_KEY=your_key_here
- Run the app:
python app.py- Must have an OpenAI API key with available credits.
- You can change the summary style and length using the optional request fields.
Jonathan Pereda