Teach me how to use the http request module please

Explaination
I am trying to send a post request on github gtp4 developer api and i am getting an error :

Note : the model is specified in the request and i’ve tried the request in another application and i am getting a response form the model.

This is the curl request :

curl -X POST “https://models.inference.ai.azure.com/chat/completions
-H “Content-Type: application/json”
-H “Authorization: Bearer my_api”
-d ‘{
“messages”: [
{
“role”: “system”,
“content”: “”
},
{
“role”: “user”,
“content”: “Can you explain the basics of machine learning?”
}
],
“model”: “gpt-4o”,
“temperature”: 1,
“max_tokens”: 4096,
“top_p”: 1
}’

This my module configuration

Hey @slaymane_slime,

In your request content, please delete the quotes ’ at the beginning and at the end.

Please let us know if that works. Happy to help you.

Thanks

Dimitris Goudis

1 Like

Hi, thank you for your help, i have tried without the quotes and i got this error

Error message

I discovered a solution :
I made a simple HTTP request and included the model name in the header.

The request :


2 Likes

Happy to see that @slaymane_slime,

In you initial post the problem was in body. Then the problem was on how you used to perform the api call.