OpenAIKeyCredential class

The OpenAIKeyCredential class represents an OpenAI API key and is used to authenticate into an OpenAI client for an OpenAI endpoint.

Constructors

OpenAIKeyCredential(string)

Create an instance of an AzureKeyCredential for use with a service client.

Properties

key

The value of the key to be used in authentication

Methods

update(string)

Change the value of the key.

Updates will take effect upon the next request after updating the key value.

Constructor Details

OpenAIKeyCredential(string)

Create an instance of an AzureKeyCredential for use with a service client.

new OpenAIKeyCredential(key: string)

Parameters

key

string

The initial value of the key to use in authentication

Property Details

key

The value of the key to be used in authentication

string key

Property Value

string

Method Details

update(string)

Change the value of the key.

Updates will take effect upon the next request after updating the key value.

function update(newKey: string)

Parameters

newKey

string

The new key value to be used