This is a sample project that uses OpenAI API to generate content. The content is generated by GPT-4o-mini model, max_tokens is 500, temperature is 0.7. The content is written in Vietnamese. The content is a short post for social media.
- Step 1: Add OpenAI API Key:
- Create OpenAI API Key at OpenAI API
- Create
.envfile inbackendfolder and add your OpenAI API Key asOPENAI_API_KEY
- Step 2: Install dependencies:
npm install - Step 3: Run server:
npm start
Then you can see the server running at http://localhost:5000 (or the port that you have set in .env file).
- Step 1: Install dependencies:
npm install - Step 2: Run server:
npm run dev
Then you can see the frontend running at http://localhost:5173.