Class NonAzureOpenAIKeyCredential

java.lang.Object
com.azure.ai.openai.models.NonAzureOpenAIKeyCredential

public final class NonAzureOpenAIKeyCredential extends Object
Non-Azure OpenAI API keys credential class for accepting non-Azure OpenAI API key credential string.
  • Constructor Details

    • NonAzureOpenAIKeyCredential

      public NonAzureOpenAIKeyCredential(String key)
      Create a non-Azure OpenAI API key credential.
      Parameters:
      key - non-Azure OpenAI API key.
      Throws:
      NullPointerException - If key is null.
      IllegalArgumentException - If key is an empty string.
  • Method Details

    • getKey

      public String getKey()
      Retrieves the key associated to this credential.
      Returns:
      The key being used to authorize requests.
    • update

      public NonAzureOpenAIKeyCredential update(String key)
      Update the OpenAI API key value.
      Parameters:
      key - The OpenAI API key value.
      Returns:
      the object itself.