Getting 401 error for connection in custom app but works via curl elsewhere - Groq

i see on the cURL example you are using POST method and pass the param with -d
which means data (body)

and on the custom app you are using qs which is query params and you need to pass the data in the bodyy and not in the query params:

"body": {
“messages”: [ { “role”: “user”, “content”: “can you hear me?” } ],
“model”: “mixtral-8x7b-32768”
}