ezzcodeezzlife / dalle2-in-python

Use DALL·E 2 in Python
https://pypi.org/project/dalle2/
MIT License
178 stars 34 forks source link

Prevent API scope error #13

Open kilianso opened 1 year ago

kilianso commented 1 year ago

Hey there 👋 Nice project! I just ran into a missing_scope error and after some research, I read that OpenAI automatically changes API keys when they detect access from external domains.

Same has been reported on the Node project. https://github.com/ezzcodeezzlife/dalle-node/issues/13

However, changing the token manually is of course a solution but i was wondering if there's a way to automate it. In a production app, we would need a way to retrieve and renew it programmatically. Any ideas?

github-actions[bot] commented 1 year ago

Thanks you for your first issue in dalle2-in-python

kv-crosstech commented 1 year ago

For the text models (GPT-3) OpenAI released well-documented API and you can get permanent API key for yourself. I assume there will be same situation once they release DALLE-2 to the public. So we all have to wait to get this functionality without manual retreiving of access tokens

ezawadzki commented 1 year ago

I still have this issue with a permanent access token :

{
  "error": {
    "message": "Your key is missing a required scope: app.labs",
    "type": "invalid_request_error",
    "param": null,
    "code": "missing_scope"
  }
}
ezzcodeezzlife commented 1 year ago

@ezawadzki you have to use your temporary bearer key like explained in the readme

ezawadzki commented 1 year ago

Oh ! thanks @ezzcodeezzlife , I read your documentation too quickly. Hope we can use one day permanent tokens.

ezzcodeezzlife commented 1 year ago

Hope we can use one day permanent tokens.

currently looking into this 🚀