openai.ChatCompletion error using version 1.0.0 of OpenAI Library

Heyo Diet,

I am having the same issue and I cant get around it. I am not a programmer and I am at last step of having Chatgpt to become my email companion. How can I resolve this error described above:

*"You tried to access openai.Completion, but this is no longer supported in openai>=1.0.0 - see the README at *

You can run openai migrate to automatically upgrade your codebase to use the 1.0.0 interface.

Alternatively, you can pin your installation to the old version, e.g. pip install openai==0.28

A detailed migration guide is available here: "

I tried to just paste this from the documentation you provided to the header of the code, but It hasn’t worked.

"from openai import OpenAI
client = OpenAI()

client.completions.create(

  • model=“gpt-4”,*
  • prompt=“Say this is a test”,*
  • max_tokens=7,*
  • temperature=0*
    )"

Do you mind to give me a help here? I would really appreciate it.

Thanks man

1 Like