A simple Express middleware for generating baby names based on parents' names using OpenAI's GPT model. Provided by SeeYourBabyAI.
npm install ai-baby-name-generator
const express = require('express');
const createAIBabyNameGenerator = require('ai-baby-name-generator');
const app = express();
const OPENAI_API_KEY = 'your-api-key-here';
app.use('/babyname', createAIBabyNameGenerator(OPENAI_API_KEY));
app.listen(3000, () => {
console.log('Server is running on port 3000');
});
Send a POST request to /babyname
with the following body:
{
"partner1": "John",
"partner2": "Jane",
"gender": "male",
"token": "unique-user-token"
}
The response will contain an array of suggested baby names.
This package requires a valid OpenAI API key. Make sure to keep your API key secure and do not expose it in your code.