HTTP/1.1 404 Resource Not Found

Hi,

I am getting this error when trying to prompt Azure OpenAI:

HTTP Request: POST hxxps://XXXX.openai.azure.com/openai/completions?api-version=2023-07-01-preview “HTTP/1.1 404 Resource Not Found”

Below is my code:

from langchain_openai import AzureOpenAI
from langchain_community.utilities import Requests

os.environ[‘OPENAI_API_VERSION’] = “2023-07-01-preview”
os.environ[‘AZURE_OPENAI_ENDPOINT’] = “hxxps://XXXX.openai.azure.com”
os.environ[“OPENAI_API_KEY”] = “XXXXXXXXXXXX”

llm = AzureOpenAI(model_name=“text-davinci-003”, max_tokens=700)

print(llm(“hi”))

Please help me fix the issue.

With Azure, you must deploy a specific model and include a deployment ID as model in the API call.

It is unlikely that you have maintained access to text-davinci-003, as it was shut off for new deployments like last July.

1 Like

Thank you for responding.

I got the key and model from my team. I’ll check with them about deploying a specific model.