An Azure service to easily conduct machine translation with a simple REST API call.
Hey Nikita Khandare ,
A 401 Unauthorized error from the Azure Translator Text service usually indicates an authentication or endpoint mismatch, even if the same key and endpoint were working earlier. Since the issue is also reproducible from the Try It tool, this suggests the problem may be with the Translator resource configuration rather than your client code.
You may try the following checks:
Verify endpoint type: Global Translator resources use: https://api.cognitive.microsofttranslator.com Whereas regional resources must use the custom endpoint: https://<your-resource-name>.cognitiveservices.azure.com
Check authentication headers: Required header: Ocp-Apim-Subscription-Key: <your-key> For regional or multi‑service Translator resources, you must also include: Ocp-Apim-Subscription-Region: <your-resource-region> This header is optional for global Translator resources.
Validate active key: Navigate to Translator resource → Keys and Endpoint in Azure portal and ensure the key in use hasn’t been regenerated. You may also regenerate one of the keys and update your application.
- Review resource/subscription state: Confirm the Azure subscription is active, and the Translator resource hasn’t been deleted or recreated (which would invalidate previously used keys).
If the issue persists, please capture the exact timestamp of failure along with the X-RequestId response header for further backend investigation and share it in Private message.
Reference: Translator Authentication – https://dotnet.territoriali.olinfo.it/azure/ai-services/translator/text-translation/reference/authentication