Learn R Programming

air (version 0.2.2)

set_key: Securely stores your your OpenAI API key to your OS keyring.

Description

Securely stores your your OpenAI API key to your OS keyring.

Usage

set_key(key = NULL)

Value

No return value; only side-effect and message printed to console

Arguments

key

Optional string of your OpenAI API key; if not provided, a popup will ask you to enter it (safer).

Examples

Run this code
# CAREFUL: Changes your OpenAI API key in your OS keyring
if (FALSE) {
set_key("sk-my-api-key") # sets the key directly (will show in .Rhistory)
set_key()                # opens a system popup for secure entry
}

Run the code above in your browser using DataLab