OpenAI API Service

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

Creating an OpenAI Account

Creating an OpenAI API Key

Setting the OpenAI API Key in .Renviron

To modify the .Renviron file:

#| eval: false
require(usethis)
edit_r_environ()

For a persistent setting, add the following line to .Renviron, replacing "<APIKEY>" with your actual API key:

OPENAI_API_KEY="<APIKEY>"

Save the file and restart your R session for the changes to take effect.

Caution: Ensure .Renviron is included in your .gitignore file to avoid exposing your API key with version control systems like GitHub or GitLab.

Important Note: OpenAI API requires valid payment details in your OpenAI account to function. This is a restriction imposed by OpenAI and is unrelated to this package.



Try the gptstudio package in your browser

Any scripts or data that you put into this service are public.

gptstudio documentation built on May 29, 2024, 12:30 p.m.