Hello Sambhav Yadav,
Thank you for reaching out on Microsoft Q&A.
The error Access denied due to invalid subscription key or wrong API endpoint usually occurs when:
The subscription key used is invalid or expired.
The endpoint URL does not match the region where your Computer Vision resource is deployed.
The resource itself is disabled or deleted.
Please check the following:
In the Azure portal, go to your Computer Vision resource → Keys and Endpoint.
Ensure you are using the correct key and the matching regional endpoint in your code. For example:
https://<your-resource-name>.cognitiveservices.azure.com/
Replace any hardcoded or incorrect endpoint/keys with the values from your portal.
For more details, see Microsoft documentation here:
Authenticate requests to Azure AI services
I hope this helps.
If the information is useful, please accept the answer and upvote it to assist other community members.