Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SyntaxError: Unexpected token 'I', "Incorrect "... is not valid JSON #20

Open
alex-maaz opened this issue Jan 31, 2023 · 17 comments
Open

Comments

@alex-maaz
Copy link

I get this when I try to generate an image. how do I fix this? I am using the right APIs and I checked the code more than once and there is no typos and errors. Any help is appreciated, thanks.

@kevmhughes
Copy link

Use a new secret API key from Openai in the .env file.

@alex-maaz
Copy link
Author

I did. Still not fixed

@LucioFider
Copy link

Use a new secret API key from Openai in the .env file.

Thank you man. Had the same issue and This fixed! it for me.

@Mohsin278
Copy link

I am having same issue

@Azzam1503
Copy link

I think you have typed apikey instead of apiKey in dalleRoutes openAI configurations, apiKey should be in camel case.

@PedroLab0
Copy link

OpenAI gives $18 to new users. You have probably already spent it using one of their services. I recommend you to create another account and generate a new api key or pay to use it. Once it is set up it will not give you any more problems.

@siddharthpraja
Copy link

That's my new account and still I'm getting this error

@siddharthpraja
Copy link

Uploading Screenshot_2023-03-19-10-09-31-44_40deb401b9ffe8e1df2f1cc5ba480b12.jpg…

@Komal-J04
Copy link

Same issue. apiKey is correctly typed in camelCase and my account is new, haven't exhausted the credits yet

@srihari20031
Copy link

srihari20031 commented Mar 30, 2023 via email

@harshit0571
Copy link

Same issue. apiKey is correctly typed in camelCase and my account is new, haven't exhausted the credits yet

Thanks @Komal-J04 ,
It worked for me

@Saksham1005
Copy link

I just want to ask that even if we want to use our free credits do we have to register our card on the site?

@harshit0571
Copy link

I just want to ask that even if we want to use our free credits do we have to register our card on the site?

Yes we have to add our card in.
But can set the limit for your card.

@starlove54
Copy link

i got the error SyntaxError: Unexpected token ''', "'prompt' i"... is not valid JSON, turned out my headers object has a typo

@yashwant1711
Copy link

Having the same problem, does not figure out how to fix it :(

@shailja168
Copy link

oh man, you literally are a savior. Took me 2 hours to do every stupid to complex solution just to know that it was a 'K'. wow. Thank YOU.

@thisissuman
Copy link

Having the same problem, does not figure out how to fix it :(

Hii,

If you are still getting the error(and in the Developer tool > Network tab > Preview if you are getting Invalid API key 401 error), then Just clear your cache and cookies(I repeat both cache and cookies) of your browser, restart your server and client.
If you have generated multiple API key, then just delete the rest and use only one. if you have used the api key in some other project before then take that API key and delete the rest.
It will surly work...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests