Azure AI Foundry / Azure OpenAI API endpoint for listing model deployments

Wout den Buurman 0 Reputation points
2025-08-12T07:49:14.16+00:00

I'm looking for a way to list the currently deployed models in my Azure OpenAI resource. I want to access these models so I can choose a model from the deployed models to give an answer to the question I've asked. The different models have almost identical endpoints:
https://<resource>.openai.azure.com/openai/deployments/<model>/chat/completions?api-version=2025-01-01-preview

Preferably, I want this to happen by using the same endpoint/API-key configuration I need for the chat completion to work, which already works with my current settings. What I am looking for, is an endpoint like:
https://<resource>.openai.azure.com/openai/deployments?api-version=2025-01-01-preview that returns a list of deployed resources:

{ 
	Id = "gpt-4.1", 
	Name = "GPT-4.1",
	... 
}, 
{ 
	Id = "gpt-4.1-mini", 
	Name = "GPT-4.1 Mini",
	...
}, 
{ 
	Id = "gpt-4.1-nano",
	Name = "GPT-4.1 Nano",
	...
}

I did not find any endpoints in the documentation unfortunately.

Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
{count} votes

1 answer

Sort by: Most helpful
  1. Manas Mohanty 13,425 Reputation points Moderator
    2025-08-14T05:49:28.25+00:00

    Hi Wout den Buurman

    If the customer has Cognitive Service OpenAI User (can not use Api keys) or contributor( can use API key for inference calls), we can use "az login --identity" and outputs respective deployment.

    Option 1

    az login --identity
    az cognitiveservices account deployment list -g <rgname>-n <openaIaccountname>
    
    
    

    Reference

    https://learn.microsoft.com/en-us/azure/ai-foundry/openai/how-to/create-resource?pivots=cli ( to list and create deployments)

    Azure OpenAI roles

    I don't think that we can use "https://<resource>.openai.azure.com/openai/deployments?api-version=2025-01-01-preview" to get the list in mentioned format.

    Option 2

    Else you can create a list with model deployment names and

    deploy = [ "gpt-4.1", "gpt-4.1-mini"..] #prompt the list to user

    based on above input, it will send inference calls to below endpoint

    https://<resource>.openai.azure.com/openai/deployments/deploy/chat/completions?api-version=2025-01-01-preview

    Thank you for understanding.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.