I’ve tried to use chatgpt 4.0 with my api key in Node.js.
But I get 404 error like this.
Request failed with status code 404
And This is my code.
import { Configuration, OpenAIApi } from 'openai';
const configuration = new Configuration({ apiKey: process.env.CHATGPTKEY });
const openai = new OpenAIApi(configuration);
const props = {
model: 'gpt-4-0314',
prompt: prompt,
temperature: 0.7,
top_p: 1,
frequency_penalty: 0,
presence_penalty: 0,
max_tokens: 200,
stream: false,
n: 1
};
let data = await openai.createCompletion(props);
How can I fix this issue and use chatgpt-4?
I wanna you can solve this for me.
Thank you. Cheers