Skip to content

Support accessing Azure AI V1 API without api-version#23

Merged
thekid merged 3 commits into
mainfrom
feature/optional-api-version
Feb 21, 2026
Merged

Support accessing Azure AI V1 API without api-version#23
thekid merged 3 commits into
mainfrom
feature/optional-api-version

Conversation

@thekid
Copy link
Copy Markdown
Member

@thekid thekid commented Jan 24, 2026

This pull request makes supplying an api-version (either through the constructor parameter or inside the endpoint URI) optional. This adds support for the Azure AI V1 API.

TL;DR (as per the linked medium article):

No api-version needed.
Just use the /openai/v1 endpoint and your deployment name.

Example

use com\openai\rest\AzureAIEndpoint;
use util\cmd\Console;

// Using V1 API
$ai= new AzureAIEndpoint('https://'.getenv('AZUREAI_API_KEY').'@example.openai.azure.com/openai/v1');

// Using API version
$ai= new AzureAIEndpoint(
  'https://'.getenv('AZUREAI_API_KEY').'@example.openai.azure.com/openai/deployments/gpt-5.2',
  '2025-04-01-preview'
);

Console::writeLine($ai->api('/responses')->invoke([
  'model' => 'gpt-5.2',
  'input' => $prompt,
]));

See also

@thekid thekid added the enhancement New feature or request label Jan 24, 2026
@thekid thekid merged commit 7fd7646 into main Feb 21, 2026
16 checks passed
@thekid thekid deleted the feature/optional-api-version branch February 21, 2026 09:03
@thekid thekid restored the feature/optional-api-version branch February 21, 2026 09:04
@thekid
Copy link
Copy Markdown
Member Author

thekid commented Feb 21, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant