How do I resolve error DeploymentNotFound for Azure OpenAI Python API call?

Amin, Ishmael 10 Reputation points
2023-03-13T19:02:06.3533333+00:00
I'm gettin the following error message when calling the Azure OpenAI API using Python json.  
#<Response [404]>
#{
#    "error": {
#        "code": "DeploymentNotFound",
#        "message": "The API deployment for this resource does not exist. If you #created the deployment within the last 5 minutes, please wait a moment and try #again."
#    }
#}
Not Monitored
Not Monitored
Tag not monitored by Microsoft.
37,118 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Amin, Ishmael 10 Reputation points
    2023-03-14T15:39:50.4666667+00:00

    I resolved the issue by removing hyphens from the deployment name. The problem is that the model deployment name create prompt in Azure OpenAI, Model Deployments states that '-', '', and '.' are allowed. However, when you create the deployment name in the OpenAI Studio, the create prompt does not allow '-', '', and '.' . This is inconsistent between the two different methods to create a deployment name.

    1 person found this answer helpful.

  2. 2023-06-09T06:08:49.3666667+00:00
    String azureOpenaiKey = System.getenv("AZURE_OPENAI_KEY");;
    String endpoint = System.getenv("AZURE_OPENAI_ENDPOINT");;
    String deploymentOrModelId = "gpt-35-turbo";
    把上面这个deploymentOrModelId 修改成自己的就不会有问题了,官方并没有提示要改,但其实要改
    
    1 person found this answer helpful.
    0 comments No comments

  3. Audio 0 Reputation points
    2023-06-08T08:19:49.79+00:00

    The build name must as same as model name, it work for me.

    0 comments No comments