Learn R Programming

accept (version 1.0.2)

set_openai_api_key: Set OpenAI API key

Description

NLP functionalities require a paid OpenAI API key to communicate with Open AI models.

Usage

set_openai_api_key(key, overwrite = FALSE, temporary = FALSE)

Arguments

key

an OpenAI API key. For more information on keys see the OpenAI API blog

overwrite

Option to overwrite any existing OpenAI keys already stored locally.

temporary

Option to not store thew API key for use across sessions.

Examples

Run this code
if (FALSE) {
set_openai_api_key("YOUR_OPENAI_API_KEY")

# This will set the key permanently until overwritten again
set_openai_api_key("YOUR_OPENAI_API_KEY")
}

Run the code above in your browser using DataLab