Create Message Endpoint Error

Can someone help with this error when calling the create message Endpoint?

{"body":{"error":{"code":"missing_required_parameter","message":"Missing required parameter: 'role'.","param":"role","type":"invalid_request_error"}},"code":400,

This is my body

{"content":"How does AI work? Explain it in simple terms.","role":"user"}

Maybe you want to tell the endpoint what thread you are adding the message to also?

You could switch role to being the first parameter in case the API is being fickle just for you.

The forum software also changes straight quotes into directional quotes. If you copied from the forum in a similar way as your post is currently showing, your JSON string may not be parse-able.

Thanks for the quick response.
I send the ThreadID as part of the url
and brought role to the first place. Still the same error

I assume you would have encountered this first in other API calls, but are you sending the "OpenAI-Beta: assistants=v2" header?

It also may be that the first parameter to be parsed is reported on when there is simply no body included at all. You might just run the python API reference example and see that you are able to make the call, and then adapt what works to python requests library to send it more “raw”, then to infer that operation to the code that is supposed to be producing that body.

Do you have an account organization where the API key has been funded with prepaid credits and has all the rights turned on?

I have already established calls to create Threads and Runs, can Create Assistants, All List functions are working. So using the right header.
Body construction is kind of straight forward.
The account is running proper. Scratching my head.

have also tried this
{“content”:{“text”:“Dies ist eine Beispielnachricht.”,“type”:“text”},“role”:“user”}

no changes at all. Also concatenating the " doesn’t help. Not a little change in the response .

Update: when I call the retrieve Thread endpoint it has status HTTP/1.1 307 Temporary Redirect

Created a new Thread. 200 used this ThreadID in the Url. Same result.

Played also with just sending a role without a content String. Same Result. Strange.

Can someone confirm, that this is the right endpoint to create a new message in the Assistant API?
https://api.openai.com/v1/threads/myThreadID/messages

The Help Support wants to guide me to the /completion Endpoint, which so is not right, regarding to the API Docs.