Skip to content

feat(client): support new unified Azure URL scheme #554

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Aug 6, 2025

Conversation

jpalvarezl
Copy link

@jpalvarezl jpalvarezl commented Jul 24, 2025

Proposed changes:

  • Adding necessary changes to support /openai/v1 Azure endpoints (referred to as "unified", as in "unified with the OpenAI schema", meaning that the model/deployment is not a path parameter of the request URL and api-version is optional).
  • Currently the services still requires an api-version query parameter with the value of preview, but in the future the omission of this query parameter will result in the service defaulting to v1 meaning "latest".
  • Added unit tests
  • Added samples and updated old ones
  • Added azureUrlPathMode enum as a manual switch between the old behaviour of adding deployment name to the URL and the OpenAI unified URL schema. (Added as an enum to future proof)

Azure URL handling changes

  • Added support for new hosts ("services.ai.azure.com") for unified Azure endpoints. (no longer injecting model name in the path. api-version is optional)
  • Other hosts flagged as Azure, are treated the old way (deployment or model name is added to the path. api-version is required)

For a more detailed discussion on the spec please refer to this message in the original PR thread.

cc: @srnagar and @trrwilson

@jpalvarezl jpalvarezl requested a review from a team as a code owner July 24, 2025 08:34
@TomerAberbach TomerAberbach changed the base branch from main to next July 24, 2025 20:10
@jpalvarezl jpalvarezl requested a review from TomerAberbach July 30, 2025 12:07
@jpalvarezl
Copy link
Author

Updated the azureLegacyPaths: Boolean toggle to be azureUrlPathMode: AzureUrlPathMode enum. Just giving a heads up to @trrwilson and @srnagar, since this deviates a bit from the original proposal (mainly concerned about objections to the naming, since everyone was already agreeing as having this as an enum instead).

@TomerAberbach TomerAberbach changed the title Proposal for handling new unified Azure URL schema feat(client): support new unified Azure URL scheme Aug 6, 2025
@TomerAberbach TomerAberbach merged commit 9aacff0 into openai:next Aug 6, 2025
0 of 3 checks passed
@stainless-app stainless-app bot mentioned this pull request Aug 7, 2025
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.

3 participants