A simple Express middleware for generating speech outlines using OpenAI's GPT model. Provided by Speech Generator AI.
npm install aispeechoutlines
const express = require('express');
const createAISpeechOutlineGenerator = require('ai-speech-outline-generator');
const app = express();
const OPENAI_API_KEY = 'your-api-key-here';
app.use('/generate-outline', createAISpeechOutlineGenerator(OPENAI_API_KEY));
app.listen(3000, () => {
console.log('Server is running on port 3000');
});
Send a POST request to /generate-outline
with the following body:
{
"topic": "Climate Change",
"purpose": "informative",
"audience": "college students",
"duration": "10-minute",
"keypoints": "causes, effects, solutions",
"token": "unique-user-token"
}
The response will contain a JSON object with the generated speech outline.
This package includes built-in rate limiting. Each unique token is limited to 5 requests per 24-hour period.
This package requires a valid OpenAI API key. Make sure to keep your API key secure and do not expose it in your code.