project_ai_mern_image_generation
project_ai_mern_image_generation copied to clipboard
SyntaxError: Unexpected token 'I', "Incorrect "... is not valid JSON
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.
Use a new secret API key from Openai in the .env file.
I did. Still not fixed
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.
I am having same issue
I think you have typed apikey instead of apiKey in dalleRoutes openAI configurations, apiKey should be in camel case.
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.
That's my new account and still I'm getting this error
Same issue. apiKey is correctly typed in camelCase and my account is new, haven't exhausted the credits yet
I haven't found the solution yet bro but if you try Giving the API key in dallesroute and call there itself may come . Another solution is that it's not basically a solution if you use new API key it may come try it. Sorry I couldn't provide the correct solution
On Tue, 28 Mar, 2023, 7:46 pm Komal, @.***> wrote:
Same issue. apiKey is correctly typed in camelCase and my account is new, haven't exhausted the credits yet
— Reply to this email directly, view it on GitHub https://github.com/adrianhajdin/project_ai_mern_image_generation/issues/20#issuecomment-1486980830, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZGD7Q3DYL4QSO2CKNSQF23W6LXD5ANCNFSM6AAAAAAUM72MCE . You are receiving this because you commented.Message ID: @.*** .com>
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
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?
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.
i got the error SyntaxError: Unexpected token ''', "'prompt' i"... is not valid JSON, turned out my headers object has a typo
Having the same problem, does not figure out how to fix it :(
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.
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...