Refused to set unsafe header "User-Agent" Error with Dall-E API request

Trying the Dall-E api, give the Refused to set unsafe header “User-Agent” Error.
Why would Open AI set this so strict, to only be possible to make requests from a server side application ? Defi apps work fine with a bearer authentication also, from a client-side configuration.

The other API’s to make the OpenAI completions (with other libraries) work fine though.
Anyone knows a workaround ? Or will the Dall-E API be integrated into the other libraries also ?

1 Like

u can make a little bugfix, go to the line where the error drops and replace:

request.setRequestHeader(key, val);


if (key != "User-Agent") {
    request.setRequestHeader(key, val);