This project demonstrates how to use OpenAI's GPT-3 model to generate an image with vanilla JavaScript and Node.js. You can try out a demo of this project Demo
Node.js A OpenAI API key (sign up for one here) Installation Clone this repository: git clone https://github.com/AmalShalabi/openAI-image.git Navigate to the project directory: cd ai_image- Install the dependencies: npm install
Create a .env file in the project root and add your OpenAI API key:
OPENAI_API_KEY=your-api-key-here
Run the script: node index.js
The OpenAI API has rate limits, so if you run into any issues, try waiting a few minutes before trying again.