OpenAI key error

I am getting an error when trying to use the OpenAI key. I searched the forum but could not find a solution to my problem.

Basically I get an error and no answer from the API request.

I added the key and named it also like in the scrim.

Hey @Polaski, some things to check:

  • Do you have any funds on your Open AI account?
  • If you right-click on the openai dependency in the explorer bar (openai@4.29.2) and then click “update”, does this fix anything?

Hi, yes, I have credit that I recently bought for this course but still shows as unused.

I just tried updating it but I still get the same error :frowning:

Could you try removing the openai module and then add the dependency back in but with the version openai@4.14.2? I had to do this recently for one of my errors.

It works!


For sanctioned countries, turning on the VPN is necessary btw.

1 Like

I can’t make it work, i’m following the course but it gives me error 429 exceeded quota but I never use it, so I can’t exceed any quote. I try several model but it never works

import OpenAI from ‘openai’

const openai = new OpenAI({
dangerouslyAllowBrowser: true,
apiKey: ‘MY-API’

})

const messages = [
{
role: ‘system’,
content: ‘You are a helpful general knowledge expert.’
},
{
role: ‘user’,
content: ‘Who invented the television?’
}
]

const response = await openai.chat.completions.create({
model: ‘gpt-4’,
message: messages
})

What I’m doing wrong?

Hey @roroland, could you see what your usage data shows here: https://platform.openai.com/usage? Wondering if it’s showing it’s over quota there.