Fix Azure OpenAI v1 Chat Completions 404

Independent setup guidance. Guides and local tools are free; provider inference has its own terms. The site-provided pool is separate.

For Azure's v1 API, use the standard OpenAI client, an /openai/v1/ base URL and your deployment name as model. If your captured URL contains /openai/v1/deployments/…, check whether a dated-API AzureOpenAI configuration was combined with the v1 prefix.

Compare the actual request path

These three paths were captured from openai 7.43.0 using local, handwritten responses. The SDK constructed the requests; no Azure request was sent. The deployment and version labels below are synthetic.

SetupCaptured path and client
v1/openai/v1/chat/completions

Standard OpenAI with the v1 base. No injected deployment segment or dated query.

Mixed/openai/v1/deployments/my-chat-deployment/chat/completions?api-version=example-dated-version

AzureOpenAI with the v1 base. Use the client and prefix belonging to the API you intend.

Dated/openai/deployments/my-chat-deployment/chat/completions?api-version=example-dated-version

AzureOpenAI with the resource root. A deployment path is expected for that separate contract.

A 404 alone does not identify this mistake. If the URL already has the intended shape, continue with the resource, deployment, operation and access checks. Keep the full status and response body rather than replacing keys repeatedly.

The model field is your deployment name

v1 base URL
https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1/
Model
The exact deployment name in that resource, such as the fictional my-chat-deployment.
Credential
The matching Azure resource key or the documented Microsoft Entra token flow.

A public model name works only if you chose that same deployment name. Do not copy a model ID from another host and assume Azure created a matching deployment. Microsoft also documents the services.ai.azure.com resource-host format; keep the endpoint supplied for your own resource.

Configure the standard v1 client

Set AZURE_OPENAI_BASE_URL to the complete v1 base shown above, AZURE_OPENAI_DEPLOYMENT to your deployment name, and AZURE_OPENAI_API_KEY locally. This API-key example sends a real request if you run it; it requires your own supported deployment and account. Microsoft's v1 documentation also covers managed Entra authentication.

Azure v1 JavaScript setup
import OpenAI from "openai";

const baseURL = process.env.AZURE_OPENAI_BASE_URL;
const apiKey = process.env.AZURE_OPENAI_API_KEY;
const deployment = process.env.AZURE_OPENAI_DEPLOYMENT;
if (!baseURL || !apiKey || !deployment) {
  throw new Error("Set the Azure v1 base URL, resource key and deployment name.");
}

const client = new OpenAI({
  baseURL,
  apiKey,
});

const response = await client.chat.completions.create({
  model: deployment,
  messages: [{ role: "user", content: "Reply briefly." }],
});
console.log(response.choices[0]?.message.content);

The current SDK documentation keeps AzureOpenAI for dated API versions. Azure v1 does not require a dated api-version parameter. Changing the base URL does not convert an operation or add model features: use a deployment supporting the selected API. For a separate /responses routing problem, see the AI SDK or LangChain guide.

Check SDK routing without a key

Download the no-key route check

Save the file in an empty folder with Node.js 22 or later, then run:

Run the no-key Azure routing check
npm install --ignore-scripts openai@7.43.0
node azure-v1-route-check.mjs

Installation downloads the SDK. The check itself supplies a synthetic key, reserved example.invalid host and injected responses, then asserts all three paths and the unchanged deployment-name body. It prints the capture; it does not test Azure eligibility, authentication acceptance or model output. Our recorded run additionally denied network access at the operating-system level.

What the original report establishes

Issue #1684 reported the mixed v1/deployment path with openai 6.3.0 in October 2025. It was closed when documentation/example PR #1692 merged on 23 June 2026. This is a configuration distinction supported by the current guide and our local capture; it is not an unresolved-bug claim about every installed version.

Sources and no-key SDK capture checked 25 October 2026. No Azure account, deployment, real key or model request was used. ChinaGenAI's own free Chat Completions route uses separate settings and does not provide an Azure deployment.

Exact symptom wording and source

Use the quoted text to locate the relevant check. Providers and clients can phrase the same failure differently; compare the complete response before applying a fix.

  • Reported text: Azure OpenAI v1 404: /openai/v1/deployments/{model}/chat/completions

    Compare the client class and API contract; the current SDK guide uses standard OpenAI for v1 and AzureOpenAI for dated APIs. A 404 alone does not prove this cause.

    Open this check

    POST {endpoint}/openai/v1/deployments/{model}/chat/completions?api-version=preview

    OpenAI Node #1684: 6.3.0 report, closed June 2026