2

I am using AzureOpenAI Service, and I just encountered an issue openai.NotFoundError: Error code: 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.'}}.

A quick Python example is attached here (need to first pip install openai and export the Azure-related environment variables).

import os
from openai import AzureOpenAI

AZURE_OPENAI_API_KEY = os.getenv("AZURE_OPENAI_API_KEY")
AZURE_OPENAI_ENDPOINT = os.getenv("AZURE_OPENAI_ENDPOINT")
client = AzureOpenAI(
    api_version="2024-02-01",
    api_key=AZURE_OPENAI_API_KEY,
    azure_endpoint=AZURE_OPENAI_ENDPOINT,
)

_tmp_messages = [
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": "How many 'r's in strawberry?"}
]

_tmp_completion = client.chat.completions.create(
    model="gpt-4o-full",
    max_tokens=8192,
    messages=_tmp_messages,
)

print(_tmp_completion.choices[0].message.content)

Previously, this code worked well under my account. And I checked the billing there is no issue. I also tried out the AI Foundry (https://ms.portal.azure.com/#home), and it didn't work either, returning a similar error:

DeploymentNotFound: 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. | Apim-request-id: xxxxxxxx

Is there anyone who knows how to fix it? Thanks for your help!

2 Answers 2

1

We were seeing this today as well with endpoints we know to be valid. Azure appears to be having (or had) some sort of downtime they haven't owned up to.

Sign up to request clarification or add additional context in comments.

Comments

0

That message may come from many different issues:

  • too old API version
  • incorrect model name
  • incorrect endpoint
  • incorrect key

Check all that. If you have access to the Azure web portal, copy the code example from there.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.