FoloUp
FoloUp copied to clipboard
不能生成题库
If you have a custom OpenAI base URL (e.g., for using Azure OpenAI or a self-hosted instance), you need to specify it in the OpenAI client initialization. You can do this by adding the baseURL parameter like this:
const openai = new OpenAI({
apiKey: process.env.OPENAI_API_KEY,
baseURL: process.env.OPENAI_BASE_URL, // Add your custom base URL here
maxRetries: 5,
dangerouslyAllowBrowser: true,
});
Make sure your .env file or environment variables include:
OPENAI_API_KEY=your-api-key
OPENAI_BASE_URL=https://your-custom-openai-endpoint
This ensures that all requests are sent to your specified base URL instead of the default OpenAI API endpoint.
I get the same problem and don't set a custom OpenAI base URL.
I checked my OpenAI secret key. It shows never used.