# Unrecognized request argument supplied: messages

**URL:** <https://community.openai.com/t/unrecognized-request-argument-supplied-messages/81459>\
**Category:** API\
**Created:** [March 2, 2023, 12:29pm UTC](https://community.openai.com/t/unrecognized-request-argument-supplied-messages/81459 "2023-03-02T12:29:26Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lauenborg](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/lauenborg/32/37472_2.png) [@Lauenborg](https://community.openai.com/u/Lauenborg)\
**Post date:** [March 2, 2023, 12:29pm UTC](https://community.openai.com/t/unrecognized-request-argument-supplied-messages/81459/1 "2023-03-02T12:29:26Z")

</div>

Im playing around with “gpt-3.5-turbo”, but Im getting the message “Unrecognized request argument supplied: messages” when trying to fetch a response. I cant really see what im doing wrong. Anyone experienced this issue?

This is my fetch:

```auto
const response = await fetch('https://api.openai.com/v1/completions', {
        headers: {
            'Content-Type': 'application/json',
            Authorization: 'Bearer ' + API_KEY,
        },
        method: 'POST',
        body: JSON.stringify({
            model: 'gpt-3.5-turbo',
            messages: [
                {
                    role: 'system',
                    content: 'You are a very funny comedian',
                },
                {
                    role: 'user',
                    content: 'Tell me a joke',
                },
            ],
        }),
    })

```

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![ruby\_coder](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/ruby_coder/32/19875_2.png) [@ruby\_coder](https://community.openai.com/u/ruby_coder)\
**Post date:** [March 2, 2023, 12:32pm UTC](https://community.openai.com/t/unrecognized-request-argument-supplied-messages/81459/2 "2023-03-02T12:32:58Z")

</div>

> [@Lauenborg](#):
>
> `response = await fetch('https://api.openai.com/v1/completions', {`

The above URI is the wrong endpoint.

Please refer to the OpenAI API `chat` method in the API docs for the correct method.

HTH

🙂

---

<div class="post-metadata">

**Author:** ![Lauenborg](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/lauenborg/32/37472_2.png) [@Lauenborg](https://community.openai.com/u/Lauenborg)\
**Post date:** [March 2, 2023, 12:34pm UTC](https://community.openai.com/t/unrecognized-request-argument-supplied-messages/81459/3 "2023-03-02T12:34:57Z")

</div>

Ohh that was a really stupid overlook haha. Thanks a bunch!

---

<div class="post-metadata">

**Author:** ![ruby\_coder](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/ruby_coder/32/19875_2.png) [@ruby\_coder](https://community.openai.com/u/ruby_coder)\
**Post date:** [March 2, 2023, 12:46pm UTC](https://community.openai.com/t/unrecognized-request-argument-supplied-messages/81459/4 "2023-03-02T12:46:48Z")

</div>

> [@Lauenborg](#):
>
> Ohh that was a really stupid overlook haha

haha

There is a lot of that going on here, so don’t worry, you are not the only one making these kinds of copy-and-paste (completion → chat) errors.

Most people make errors when they copy-and-paste, or copy-and-modify. It’s normal!

Glad to help.

🙂

---

<div class="post-metadata">

**Author:** ![DaveC](https://avatars.discourse-cdn.com/v4/letter/d/a4c791/32.png) [@DaveC](https://community.openai.com/u/DaveC)\
**Post date:** [March 2, 2023, 6:50pm UTC](https://community.openai.com/t/unrecognized-request-argument-supplied-messages/81459/5 "2023-03-02T18:50:42Z")

</div>

Can someone supply the proper URL? I am using the example in the API guide and getting the exact same issue when trying this in PostMan. I looked for the API docs and had no luck since they are what I was using to try this out

---

<div class="post-metadata">

**Author:** ![DaveC](https://avatars.discourse-cdn.com/v4/letter/d/a4c791/32.png) [@DaveC](https://community.openai.com/u/DaveC)\
**Post date:** [March 2, 2023, 6:55pm UTC](https://community.openai.com/t/unrecognized-request-argument-supplied-messages/81459/6 "2023-03-02T18:55:22Z")

</div>

I tried again and used this URL and it worked…

[https://api.openai.com/v1/chat/completions](https://api.openai.com/v1/chat/completions)

Not sure what was different from before but a few of us are hitting this issue so that is pretty weird…

Here is the proper JSON if you want to try this in the body of a Post Man Post - got a funny joke back 🙂

{  
“model”: “gpt-3.5-turbo”,  
“messages”: [{  
“role”: “system”,  
“content”: “You are a very funny comedian”  
},  
{  
“role”: “user”,  
“content”: “Tell me a joke”  
}]  
}

---

<div class="post-metadata">

**Author:** ![Lauenborg](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/lauenborg/32/37472_2.png) [@Lauenborg](https://community.openai.com/u/Lauenborg)\
**Post date:** [March 2, 2023, 7:14pm UTC](https://community.openai.com/t/unrecognized-request-argument-supplied-messages/81459/7 "2023-03-02T19:14:14Z")

</div>

I think the problem is people, me included, read thru the documentation a bit too fast and didnt recognize that the url is different from the other models.

[https://api.openai.com/v1/completions](https://api.openai.com/v1/completions) vs [https://api.openai.com/v1/chat/completions](https://api.openai.com/v1/chat/completions)

---

<div class="post-metadata">

**Author:** ![DaveC](https://avatars.discourse-cdn.com/v4/letter/d/a4c791/32.png) [@DaveC](https://community.openai.com/u/DaveC)\
**Post date:** [March 6, 2023, 7:29pm UTC](https://community.openai.com/t/unrecognized-request-argument-supplied-messages/81459/8 "2023-03-06T19:29:06Z")

</div>

Right - I see what you are saying - Thx!

---

<div class="post-metadata">

**Author:** ![mcheich](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/mcheich/32/39341_2.png) [@mcheich](https://community.openai.com/u/mcheich)\
**Post date:** [March 6, 2023, 7:52pm UTC](https://community.openai.com/t/unrecognized-request-argument-supplied-messages/81459/9 "2023-03-06T19:52:53Z")

</div>

Laughing out loud right now, because I had this same issue, and the funny part is I was updating some existing code from “text-davinci-003” to the “gpt-3.5-turbo” and I visually checked the endpoint twice to make sure it was the same (which seemed surprising to me)…so easy to miss that /chat/ in the URL!

Thanks for posting this and thanks for all the help!

---

<div class="post-metadata">

**Author:** ![foolyeah](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/foolyeah/32/118296_2.png) [@foolyeah](https://community.openai.com/u/foolyeah)\
**Post date:** [April 27, 2023, 3:15pm UTC](https://community.openai.com/t/unrecognized-request-argument-supplied-messages/81459/10 "2023-04-27T15:15:01Z")

</div>

I had the same issue, but I was able to fix it by using the correct endpoint.

I realized that I was using ‘completions’ instead of ‘chat/completions’, which caused the error. 🤣🤣🤣

---

<div class="post-metadata">

**Author:** ![EricGT](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/ericgt/32/20571_2.png) [@EricGT](https://community.openai.com/u/EricGT)\
**Post date:** [December 13, 2023, 5:37pm UTC](https://community.openai.com/t/unrecognized-request-argument-supplied-messages/81459/11 "2023-12-13T17:37:44Z")

</div>

Closed on December 13, 2023, 5:37pm UTC


