Azure / Azure/azure-sdk-for-js
Retry-After header is not returned on 429 throttled error
- Dominant language
- TypeScript
- Stars
- 2.3k
- Forks
- 1.4k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 150
Description
- "@azure/openai"
- "^2.0.0"
- **Windows**:
- [ ] **nodejs**
- **v22.14.0**:
- [ ] **browser**
- **Edge/ 143.0.3650.96 (Official build) (64-bit)**:
- [ ] **typescript**
- **^4.6.3**:
**Describe the bug**
When a get a 429 throttled response back from Azure Open AI, the `Retry-After` header is not being "returned" to the `.catch` on the SDK.
**To Reproduce**
Steps to reproduce the behavior:
1. Make a `client.chat.completions.create({ ` request to Azure Open AI and get a throttled response.
2. In the .catch try to get the Retry-after header
`.catch((error) => {
if (error.status === 429) {
const _retryHeader = error.headers.get('Retry-After');
}})`
**Expected behavior**
I would expect a way to get the retry after time.
**Screenshots**
Screenshot showing Retry-After from network request in dev tools
Screenshot of headers from sdk
Contributor guide
Assessment
This issue has not been assessed yet.