You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Confirm this is a feature request for the Python library and not the underlying OpenAI API.
This is a feature request for the Python library
Describe the feature or improvement you're requesting
Our project utilizes both OpenAI and Azure OpenAI APIs, which our organisation manages through an API gateway. The gateway provides its own short-lived JWTs and serves as a mediator between clients and these APIs, with some organisational logic over the top.
For Azure APIs, we use the AzureOpenAI.azure_ad_token_provider parameter to automatically refresh access tokens. Unfortunately, OpenAI's standard clients lack this feature.
As a workaround, we have written a custom class extending openai.AsyncOpenAI, with api_key defined as an @property getter to handle token refreshes. However, this workaround is not ideal due to the extra maintenance required. Ideally, OpenAI's clients would natively support token providers the same way as the Azure ones do.
Would there be interest in adding this feature? I'm willing to make this contribution myself!
Additional context
No response
The text was updated successfully, but these errors were encountered:
Confirm this is a feature request for the Python library and not the underlying OpenAI API.
Describe the feature or improvement you're requesting
Our project utilizes both OpenAI and Azure OpenAI APIs, which our organisation manages through an API gateway. The gateway provides its own short-lived JWTs and serves as a mediator between clients and these APIs, with some organisational logic over the top.
For Azure APIs, we use the
AzureOpenAI.azure_ad_token_provider
parameter to automatically refresh access tokens. Unfortunately, OpenAI's standard clients lack this feature.As a workaround, we have written a custom class extending
openai.AsyncOpenAI
, withapi_key
defined as an@property
getter to handle token refreshes. However, this workaround is not ideal due to the extra maintenance required. Ideally, OpenAI's clients would natively support token providers the same way as the Azure ones do.Would there be interest in adding this feature? I'm willing to make this contribution myself!
Additional context
No response
The text was updated successfully, but these errors were encountered: