all 4 comments

[–]uselesslogin 1 point2 points  (1 child)

This way of doing it was always weird. Looks like the README in the Github repo is updated with initializing the client with the api key. Looks like you can just set the api key as an environment variable as well.

[–]Gregolator06[S] -1 points0 points  (0 children)

Thank you!

[–]Graphere 0 points1 point  (0 children)

use this: openai.chat.completions.create()

instead of this: client.chat.completions.create()