Renewing an API Key

Regenerate one of the secret values for an API key in OCI Generative AI.

Important

To renew a key, you must regenerate it. Regeneration replaces the selected key value. Copy and store the new value securely because it's shown only once. Ensure your application uses the other key during rotation to avoid downtime.
    1. On the API keys list page, select the API key that you want to work with. If you need help finding the list page for API keys, see Listing API keys.
    2. In Key names and expiration times, find the key you want to rotate (Key one or Key two).
    3. Select Regenerate for to the selected key value.
    4. (Optional) Set the Key expiration date and Key expiration time (UTC).
      The default value is three months from the regeneration date.
    5. When the new key value appears, copy it and store it in a secure secrets manager.
  • Use the api-key renew command and required parameters to regenerate a specific key value:

    oci generative-ai api-key renew [OPTIONS]

    For a complete list of parameters and values for CLI commands, see the CLI Command Reference.

  • Run the RenewApiKey operation to renew one of the secrets of an API key with a new secret and a new expiration date.