GPTstudio in R not Working or Acknowledging the API Key

Trying to use GPTstudio in R-studio and I’m getting the following error, despite having an API key set:

Listening on
! OPENAI_API_KEY is not valid.
ℹ Generate a key at <>
ℹ Set the key in your .Renviron file usethis::edit_r_environ()
Warning: Error in purrr::map_chr: ℹ In index: 1.
Caused by error:
! Result must be length 1, not 0.