feat: support Azure OpenAI v1 API - #445
Merged
Merged
Conversation
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>
alex-chernyshov
requested changes
Sep 11, 2026
alex-chernyshov
approved these changes
Sep 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_idis resolved from the first of the following sources that is set:X-DIAL-OVERRIDE-NAMEheader,/openai/deployments/{deployment_name}requests,X-DIAL-DEPLOYMENT-IDheader, which DIAL Core sets when it calls the/openai/v1endpoints.An
/openai/v1request with none of the headers set fails with500 Internal Server Error.POST /openai/v1/chat/completionsPOST /openai/deployments/{deployment_name}/chat/completionsPOST /openai/v1/embeddingsPOST /openai/deployments/{deployment_name}/embeddingsPOST /openai/v1/ratePOST /openai/deployments/{deployment_name}/ratePOST /openai/v1/tokenizePOST /openai/deployments/{deployment_name}/tokenizePOST /openai/v1/truncate_promptPOST /openai/deployments/{deployment_name}/truncate_promptGET /openai/v1/configurationGET /openai/deployments/{deployment_name}/configuration