#Image generation isn't returning a response, instead this error
47 messages · Page 1 of 1 (latest)
The status code 400 means that your request had an issue. May I see it?
well, i referred to docs. Anyways here it is
1 sec
Did you accidentally leak you API key? 😄
what else could I be missing out ?
I'm not too experienced with the DALL-E API I'm sorry.
oh ok, no worries.
let url2 = response['data'][1]['url']```
?
That code seems just fine to me? Also if they're getting 400, that cannot be the issue.
400 can mean your prompt is rejected by the safety system
There is an error object in the response that tells you the reason
probably not
How could i fix that then
Did you try to console.log the response ? Maybe the answer is inside.
console.log(response.data)
well I can't, its not getting any response.
Did you try antoher way ? Like fetch, axios ?
Surely just missing smth
nope
Did you configure a payment method ?
no
Maybe it's the problem ? That's not free.
Tryexcept the call to get the rrror
What's the endpoint syntax ?
https://api.openai.com/v1/images/generations/prompt=cat
..
An API for accessing new AI models developed by OpenAI
i took that only
but this doesn't get it
I don’t understand your question
Im trying to fetch it from the endpoint using axios through that link
because that doesn't work for some reason
if you could spot the actual reason
here's the error again
It's just like to fetch anything from a endpoint.
As Moxi said, try curl first using the example in the docs
And you can also still receive information with an error header
Have you tried printing out the response object regardless?
Ok