Hello, i have an annoying problem.
I have such a code:
const configuration = new Configuration({
apiKey: "OpenAI key"
});
const openai = new OpenAIApi(configuration);
const response = await openai.createImage({
prompt: "a white siamese cat",
n: 1,
size: "1024x1024",
});
data.result = response['data'][0]['url']
console.log(data.result)
when i type the command i get this error:
Error: Request failed with status code 400
at createError (C:\Users\LORC1\OneDrive\Pulpit\Nowy folder\node_modules\openai\node_modules\axios\lib\core\createError.js:16:15)
at settle (C:\Users\LORC1\OneDrive\Pulpit\Nowy folder\node_modules\openai\node_modules\axios\lib\core\settle.js:17:12)
at IncomingMessage.handleStreamEnd (C:\Users\LORC1\OneDrive\Pulpit\Nowy folder\node_modules\openai\node_modules\axios\lib\adapters\http.js:322:11)
at IncomingMessage.emit (node:events:538:35)
at endReadableNT (node:internal/streams/readable:1342:12)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
Is anyone able to help me? I’ve tried everything and it still doesn’t work…