Skip to content

feat: support Azure OpenAI v1 API - #445

Merged
adubovik merged 5 commits into
developmentfrom
feat/azure-openai-v1-api
Sep 11, 2026
Merged

adubovik merged 5 commits into
developmentfrom
feat/azure-openai-v1-api

Conversation

@adubovik

@adubovik adubovik commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

The fix makes the adapter expose every deployment endpoint under the deployment-less Azure OpenAI v1 API path /openai/v1/*, alongside the existing /openai/deployments/{deployment_name}/* one. This is the SDK counterpart of epam/ai-dial-adapter-openai#548.

Both paths serve the same handlers and differ only in where the deployment id comes from. request.deployment_id is resolved from the first of the following sources that is set:

  1. the X-DIAL-OVERRIDE-NAME header,
  2. the deployment name from the path, for the /openai/deployments/{deployment_name} requests,
  3. the X-DIAL-DEPLOYMENT-ID header, which DIAL Core sets when it calls the /openai/v1 endpoints.

An /openai/v1 request with none of the headers set fails with 500 Internal Server Error.

New endpoint Existing equivalent
POST /openai/v1/chat/completions POST /openai/deployments/{deployment_name}/chat/completions
POST /openai/v1/embeddings POST /openai/deployments/{deployment_name}/embeddings
POST /openai/v1/rate POST /openai/deployments/{deployment_name}/rate
POST /openai/v1/tokenize POST /openai/deployments/{deployment_name}/tokenize
POST /openai/v1/truncate_prompt POST /openai/deployments/{deployment_name}/truncate_prompt
GET /openai/v1/configuration GET /openai/deployments/{deployment_name}/configuration

adubovik and others added 5 commits September 10, 2026 15:55
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Currently failing: the /openai/v1 routes are registered once per
add_chat_completion call, so every v1 request is served by the
deployment that was added first, regardless of the deployment id
resolved from the request.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The /openai/v1 endpoints are shared by all the deployments of a single
DIALApp, but they used to be registered once per deployment, so every
request was served by the deployment that was added first.

Now a single route per endpoint dispatches to the handler of the
deployment resolved from the request headers, and a request naming an
unknown deployment or an endpoint the deployment doesn't implement
fails with DeploymentNotFound. The v1 requests also set the deployment
in the logging context, which they didn't do before.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@adubovik adubovik self-assigned this Sep 10, 2026
@adubovik
adubovik enabled auto-merge (squash) September 10, 2026 17:05
Comment thread aidial_sdk/deployment/from_request_mixin.py
@adubovik
adubovik merged commit 88dc8f5 into development Sep 11, 2026
17 checks passed
@adubovik
adubovik deleted the feat/azure-openai-v1-api branch September 11, 2026 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants