Hi aditya
Deployment name
It seems that you have not put deployment name correctly.
Please change the below line
AZURE_OPENAI_DEPLOYMENT_NAME=Microsoft.CognitiveServicesOpenAI-{id}
to
AZURE_OPENAI_DEPLOYMENT_NAME=<Toyourmodeldeploymentname> //For e.g GPT-35-turbo-16k
Attached screenshot for model deployment name for reference.
API version
Please use below API version instead of 2024-05-01-preview for chat completions, embeddings, speech/whisper, on your data, Dall-e, assistants, etc.
2024-10-21 (GA)
2025-02-01-preview
Hope it fixes your rest Api calls now.
Please don’t forget to Accept Answer and Yes for "was this answer helpful" wherever the information provided helps you, this can be beneficial to other community members.
Thank you.