What is the expire time for the Azure OpenAI api key?

Dat Hoang 20 Reputation points
2024-03-26T03:35:03.6233333+00:00

Hi all,

I am using the Azure OpenAI by the api keys as below

OpenAI API Key, Azure AI Studio - Microsoft Q&A

There are 2 keys and yes they will be expired but I do not know exactly how long it will be expired.
I have some questions and if anyone knows please help to share the information:

  1. What is the expired time for the Azure OpenAI?
  2. Do both 2 keys have the same expired date?
  3. When the expired time calculated, from the first use or base on the generation time?

Thanks.

Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
3,041 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. AshokPeddakotla-MSFT 33,746 Reputation points
    2024-03-26T05:05:10.5166667+00:00

    Dat Hoang Greetings!

    Please find the below answers to your queries.

    What is the expired time for the Azure OpenAI?

    AFAIK, The expiration time for Azure OpenAI API keys is configurable and can be set by the user.

    By default, Azure OpenAI API keys expire every six months. If an API key is expired, you need to regenerate it. It is recommended to set an expiration time for security reasons.

    If you create a key programmatically using the Azure Management API, you can also specify an expiration date for the key.

    You can find more information here Authenticate requests to Azure AI services.

    Do both 2 keys have the same expired date?

    Both API keys will have the same expiration time if you set an expiration time for them. If you do not set an expiration time, both keys will not expire.

    When the expired time calculated, from the first use or base on the generation time?

    The expiration time for the API keys is calculated based on the time when the keys were generated. It is not based on the first use of the keys.

    To avoid running out of access tokens, either you can rotate the keys or you can implement a token refresh mechanism in your application or script that automatically obtains a new access token when the current token is about to expire. This can help ensure that your application or script can continue to access the OpenAI endpoint without interruption.

    You can also use Azure Key Vault to securely store and manage your access tokens.

    For more details, please refer Customer-managed keys with Azure Key Vault

    Hope this helps. Do let me know if you have any further queries.

    If this answers your query, do click Accept Answer and Yes for was this answer helpful.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.