Make sure to install the dependencies:
# npm
npm installIn your .env file, add your OpenAI API key:
OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxAnd in your nuxt.config.ts file, access the environment variable for the key:
runtimeConfig: {
// The private keys which are only available server-side
OPENAI_API_KEY: process.env.OPENAI_API_KEY,
// Keys within public are also exposed client-side
public: { }
},Start the development server on http://localhost:3000
npm run devBuild the application for production:
npm run buildLocally preview production build:
npm run previewThis is a demo application and is not intended for production use. All instructions are provided by OpenAI.