apiKey property

void apiKey=(String apiKey)

This is used to initialize the OpenAI instance, by providing the API key. All the requests will be authenticated using this API key.

OpenAI.apiKey = "YOUR_API_KEY";

Implementation

static set apiKey(String apiKey) {
  HeadersBuilder.apiKey = apiKey;
  _internalApiKey = apiKey;
}