Autorization is Sanitized in Power Automate

Hi!
I have a license for ChatGpt-4.
I am trying to connect to ChatGPT from the Power Automate flow through the HTTP request, but my authorization does not work. I get an error: “{
“error”: {
“message”: “The model gpt-4 does not exist or you do not have access to it.”,
“type”: “invalid_request_error”,
“param”: null,
“code”: “model_not_found”
}
}”

I was also trying to connect with “gpt-3.5-turbo-instruct” and “gpt-3.5-turbo”, but my authorization was also sanitized.

My example:

  • Header: Authorization,
  • Value: Bearer Sk-******
  • Body:
    {
    “model”: “gpt-3.5-turbo-instruct”,
    “messages”: [
    {
    “role”: “user”,
    “content”: “What is the color of tomato?”
    }
    ],
    “max_tokens”: 1000,
    “temperature”: 0,
    “n”: 1,
    “stream”: false,
    “stop”: null
    }

Could someone please advice how to correct my parameters to connect to ChatGPT?

Thank you!

Best regards,
Alona

Welcome to the Community!

Your curl request is incorrect. For gpt-3.5-turbo-instruct, the request needs to look as follows (using the completions endpoint https://api.openai.com/v1/completions)

{
    "model": "gpt-3.5-turbo-instruct",
    "prompt": "What is the color of tomato?",
     "max_tokens": 1000,
    "temperature": 0,
    "stop": null
}

For gpt-3.5-turbo, the curl request would be the following (using the chat completions endpoint https://api.openai.com/v1/chat/completions)

{
    "model": "gpt-3.5-turbo",
    "messages": [
        {
            "role": "user",
            "content": "What is the color of tomato?"
        }
    ],
    "max_tokens": 1000,
    "temperature": 0,
    "stop": null
}

As for the issue with gpt-4, the curl request would need to look the same as in the case of gpt-3.5.-turbo.

Also note that in order to make a successful API call, you need to make sure that you have pre-funded your OpenAI with at least USD 5 credits and they must still show as active on your usage page.

Any further questions, just let us know.

Hello!
Thank you very much for you very fast response! I really appreciate that.
I made the corrections.
I have also paid for the limits in my account, so I finally got the response from ChatGPT.

Thank you one more time and have a nice day!

1 Like