Hi @Bình Đỗ,
We have tested the scenario and were able to make successful API calls without encountering the 401 Unauthorized error. The request returned a 200 OK response, confirming that the API key and endpoint were correctly configured.
To help resolve your issue, please check the following:
- API Key Usage – Ensure you're passing the key as
api-key: <your-api-key>
in the header and not usingAuthorization: Bearer <token>
. - Correct Endpoint – Verify that your request URL matches the exact format for your Azure OpenAI deployment, including the correct region.
- Access Control – Confirm that your Azure user has the Azure OpenAI User role assigned in IAM.
- Regenerate API Key – If the issue persists, try regenerating the API key and testing again.
If you've checked these and are still facing issues, please share the exact error message and request details (excluding sensitive information) so we can assist further.
I hope you understand. Thank you.
If this answers your query, do click Accept Answer
and Yes
for was this answer helpful.