Open binyamdawit opened 1 year ago
Changed it but still getting the same error. In the console log, it seems Delle is failing the request.
Hey Even I had the same issue use the below code in CreatePost.jsx const response = await fetch("http://localhost:8080/api/v1/dalle", { method: "POST", headers: { "Content-Type": "application/json", } use this code in the try catch block of generateImage async function
I was able to fix it by using a new account for Open-AI. Works fine for me now.
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?
Nope
On Mon, Apr 3, 2023, 11:43 Saksham1005 @.***> wrote:
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?
— Reply to this email directly, view it on GitHub https://github.com/adrianhajdin/project_ai_mern_image_generation/issues/33#issuecomment-1493720705, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZ5CLZQTHWDAL3VYMVQBPH3W7JTBNANCNFSM6AAAAAAVA5CT4Q . You are receiving this because you commented.Message ID: @.*** .com>
i am doing exactly same things but not working for me :(
can anyone tell me status code while trying this code ??
was anyone able to fix it?
you need to make a new account at open ai and use the api key from the new account. You are facing this error because the api is paid. With the new account you will get 5$ worth of free credits, each api call costs 0.02$ so be careful making too much requests.
guys, use this: var openai = new OpenAIApi(configuration); instead of : const openai = new OpenAIApi(configuration);
Change const to var
is show any custom message instead of default billing message? anyone hints me.
The community showcase does not show anything the pictures are being stored on cloudinary but it just loads and does not stop
is show any custom message instead of default billing message? anyone hints me.
make a new account on openai and use a new key your old acc got expired as mine one did
There can be a few issues:
see if you are putting this
setForm({ ...form, photo: data:image/jpeg;base64,${data.photo}
})
Changed it but still getting the same error. In the console log, it seems Delle is failing the request.
how did you resolve this error
Hey Even I had the same issue use the below code in CreatePost.jsx const response = await fetch("http://localhost:8080/api/v1/dalle", { method: "POST", headers: { "Content-Type": "application/json", } use this code in the try catch block of generateImage async function
Use the above code and also create new OpenAI api acct so you get free trial of the model and yeah it works!
There can be a few issues:
- Check if you have enough credits in your Open AI account
- Put the url in double quotes instead of single ones. So it should be await fetch("", . . .
- see if you are putting this setForm({ ...form, photo:
data:image/jpeg;base64,${data.photo}
})
- you might be using single quotes instead of single ticks and it may result in the data not being fetched and read
It´s imperative to use single: setForm({ ...form, photo: data:image/jpeg;base64,${data.photo}
}); There´s a ${} in there.
made an new account on open api and the error persists SyntaxError: Unexpected token 'B', "Billing ha"... is not valid JSON anyone please help
Check if you have updated the environment variables and entered the new valid API key. Restart the server.
If you have and the problem persists, try putting the fetch url in double quotes. That is what worked for me as well as many others. Hope it helps.
yeah did all that but that doesn't work....the thing was they needed a payment method and once I registered my debit card things started working....thanks for the help.
To anyone still facing this issue there are only two solutions :
I almost tried all the other methods to solve the issue and to no use. Although in my usage section it shows I haven't used a single dollar or made a single request. So yeah maybe this is an issue by OpenAI pending to be fixed. Try the first option and it should work.
Hope it helps.
You have not upgraded to a paid plan yet. To add a payment method and start paying for API usage, go to the Billing overview page and click "Set up payment" to continue.
it is billing issue i think
https://platform.openai.com/account/usage Use this link to check out your usage and if you have any free usages left. It's clearly written just need to log in if not logged in.
Hope it helps just to know if it is that you don't have credits or there is an issue with your code if you do have credits and it still doesn't work!
Just create new account and change the response from base64 to url...thats it
For me I had to create a paid account, it did not matter if I created new accounts.
yeah did all that but that doesn't work....the thing was they needed a payment method and once I registered my debit card things started working....thanks for the help.
hey did it actually work by just registering a payment method?? you didn't do any other changes to the code??
Register new account and generate new api
On Tue, 1 Aug, 2023, 8:28 pm SETHEAD, @.***> wrote:
yeah did all that but that doesn't work....the thing was they needed a payment method and once I registered my debit card things started working....thanks for the help.
hey did it actually work by just registering a payment method?? you didn't do any other changes to the code??
— Reply to this email directly, view it on GitHub https://github.com/adrianhajdin/project_ai_mern_image_generation/issues/33#issuecomment-1660499121, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3LZL62DX4KCGLLXQSHORY3XTEKQFANCNFSM6AAAAAAVA5CT4Q . You are receiving this because you commented.Message ID: @.*** .com>
Register new account and generate new api … On Tue, 1 Aug, 2023, 8:28 pm SETHEAD, @.> wrote: yeah did all that but that doesn't work....the thing was they needed a payment method and once I registered my debit card things started working....thanks for the help. hey did it actually work by just registering a payment method?? you didn't do any other changes to the code?? — Reply to this email directly, view it on GitHub <#33 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3LZL62DX4KCGLLXQSHORY3XTEKQFANCNFSM6AAAAAAVA5CT4Q . You are receiving this because you commented.Message ID: @. .com>
I created a new account only but still it's not working. Do I need to create an account with a different phone number also?
This error occurs due to OpenAI API Credit . For this problem you need a new account with no expired credit. Check your account credit https://platform.openai.com/account/usage if credit is expire than create a new account with new mobile number it may be give you free credit or use others account which have credit left on.
Also Check ,
I also had the same issue. I tried to fix but it turns out that my credits got expired last month. Do I need to make a new account to get the free credits again?
SyntaxError: Unexpected token 'B', "Billing ha"... is not valid JSON. Solution please..
This error occurs due to OpenAI API Credit . For this problem you need a new account with no expired credit. Check your account credit https://platform.openai.com/account/usage if credit is expire than create a new account with new mobile number it may be give you free credit or use others account which have credit left on.
Also Check ,
- Home.jsx
![]()
- CreatePost.jsx
![]()
![]()
so if I do all these methods and do the changes to home and createpost page, will it work ?
Guys can someone add sign up and log in functionality to the whole application, how would i go through that. thanks guys
Hey Even I had the same issue use the below code in CreatePost.jsx const response = await fetch("http://localhost:8080/api/v1/dalle", { method: "POST", headers: { "Content-Type": "application/json", } use this code in the try catch block of generateImage async function
nope still the same error
I have tried all the above solutions but none is working:(, someone please help!
please some answer
Hello Guys, Its not the issue of the code, it is because of existing account in openai. Make new Account of OpenAi using extra google account. for new account you have some credit given to use, and these the service can be use easily.
Thanks me Later..
I have seen a lot of comments regarding this issue. Here's the solution:
In your CreatePost.jsx file the![Screenshot 2023-02-19 053921](https://user-images.githubusercontent.com/78832827/219945147-a07a8065-0bd2-4a09-a16b-5ce950ac827a.png)
Change that line on the above image to this: const response = await fetch('http://localhost:8080/api/v1/dalle', {
The reasoning is of course the domain name