# Failed to retrieve response from model: 'Chat' object has no attribute 'Completion'

**URL:** <https://community.openai.com/t/failed-to-retrieve-response-from-model-chat-object-has-no-attribute-completion/728142>\
**Category:** Deprecations\
**Tags:** api\
**Created:** [April 26, 2024, 5:15am UTC](https://community.openai.com/t/failed-to-retrieve-response-from-model-chat-object-has-no-attribute-completion/728142 "2024-04-26T05:15:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Freenerd](https://avatars.discourse-cdn.com/v4/letter/f/9fc29f/32.png) [@Freenerd](https://community.openai.com/u/Freenerd)\
**Post date:** [April 26, 2024, 5:15am UTC](https://community.openai.com/t/failed-to-retrieve-response-from-model-chat-object-has-no-attribute-completion/728142/1 "2024-04-26T05:15:46Z")

</div>

What is the updated method for the following (completion appears to have been deprecated):  
completion = openai.chat.Completion.create(  
engine=“gpt-4-turbo”,  
prompt=“What’s the meaning of life?”,  
max\_tokens=50

---

<div class="post-metadata">

**Author:** ![jr.2509](https://avatars.discourse-cdn.com/v4/letter/j/76d3ee/32.png) [@jr.2509](https://community.openai.com/u/jr.2509)\
**Post date:** [April 26, 2024, 5:34am UTC](https://community.openai.com/t/failed-to-retrieve-response-from-model-chat-object-has-no-attribute-completion/728142/2 "2024-04-26T05:34:23Z")

</div>

For chat completions models, it would look as follows:

```auto
completion = client.chat.completions.create(
    model="gpt-4-0125-preview",  
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "What’s the meaning of life?"}
        ],
    temperature=0, 
    max_tokens=500
)

print(completion.choices[0].message.content)

```

If you’d like to use a completions model, then you can use gpt-3.5-turbo instruct as follows:

```auto
completion = client.completions.create(
    model="gpt-3.5-turbo-instruct",  
    prompt="What is the meaning of life?",
    temperature=0, 
    max_tokens=500
)

print(completion.choices[0].text)

```

If in doubt, you can always refer to the API documentation [here](https://platform.openai.com/docs/api-reference).
