-
Notifications
You must be signed in to change notification settings - Fork 5.1k
[BUG] Azure OpenAI client fails with 401 when throttling #46109
Copy link
Copy link
Closed
Labels
ClientThis issue is related to a non-management packageThis issue is related to a non-management packageOpenAIService AttentionWorkflow: This issue is responsible by Azure service team.Workflow: This issue is responsible by Azure service team.customer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
Metadata
Metadata
Assignees
Labels
ClientThis issue is related to a non-management packageThis issue is related to a non-management packageOpenAIService AttentionWorkflow: This issue is responsible by Azure service team.Workflow: This issue is responsible by Azure service team.customer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
Library name and version
Azure.AI.OpenAI 2.0.0-beta.5
Describe the bug
When using
AzureOpenAIClientand sending too many requests, the Azure service throttling leads to a "401 Unauthorized" error instead of "429 Too Many Requests".Looking at the internal requests, looks like the code is retrying on 429 as expected, sending a malformed request containing the
Authorizationheader twice (with the same token).Expected behavior
The client should keep retrying on 429 and/or fail with a HTTP exception status code 429
Actual behavior
The client fails with a HTTP exception status code 401
Reproduction Steps
Output:
Environment