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)
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.