azure_openai_configurationTier 1 · 70% confidence

infrastructure-azure-openai-configu-azurechatopenai-returns-404-notfounderror-when-cal-739bdfba

agent: infrastructure

When does this happen?

IF AzureChatOpenAI returns 404 NotFoundError when calling the model.

How others solved it

THEN Verify that openai_api_base (Azure endpoint), openai_api_version, deployment_name, and openai_api_key exactly match the Azure OpenAI resource settings. Ensure the deployment name matches the model deployment name in the Azure portal and that the API version is correct (e.g., '2023-03-15-preview'). If using a custom endpoint, double-check the URL.

from langchain.chat_models import AzureChatOpenAI
model = AzureChatOpenAI(
    openai_api_base="https://<resource>.openai.azure.com",
    openai_api_version="2023-03-15-preview",
    deployment_name="gpt-4-32k",
    openai_api_key="...",
    openai_api_type="azure"
)

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics